From e4d6562511fdb80cfc52e6899a14b0dd175410ed Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Mon, 23 Sep 2024 20:08:45 +0200 Subject: [PATCH] added check for existance of OCR pdf --- script/scanRear.sh | 4 +++- script/scantofile-0.2.4-1.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/script/scanRear.sh b/script/scanRear.sh index 169f14c..d0f7e4a 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -110,7 +110,9 @@ fi "${output_pdf_file}" if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then - rm ${output_pdf_file} + if [ -f "/scans/${date}-ocr.pdf" ]; then + rm ${output_pdf_file} + fi fi ) & fi diff --git a/script/scantofile-0.2.4-1.sh b/script/scantofile-0.2.4-1.sh index 9c4de2e..177a4d2 100755 --- a/script/scantofile-0.2.4-1.sh +++ b/script/scantofile-0.2.4-1.sh @@ -85,7 +85,9 @@ "${output_pdf_file}" if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then - rm ${output_pdf_file} + if [ -f "/scans/${date}-ocr.pdf" ]; then + rm ${output_pdf_file} + fi fi ) & fi