shell-scripte-code/ocr-deamon.sh

13 lines
371 B
Bash
Raw Permalink Normal View History

2022-02-11 13:44:07 +01:00
set -x
DOKUMENT_DIR=/home/simono41/data1/Dokumente
2022-02-11 14:41:22 +01:00
find ${DOKUMENT_DIR} -path ${DOKUMENT_DIR}/.stversions -prune -type f -o -name "*.pdf" ! -name '*-ocr.pdf' -print | while read file; do
if ! [ -f "${file%.*}-ocr.pdf" ]; then
2022-02-15 08:52:01 +01:00
timeout 60 ocrmypdf -l deu+eng -c "${file}" "${file%.*}-ocr.pdf"
2022-02-11 14:41:22 +01:00
sleep 1
else
echo "Datei wurde bereits verarbeitet"
fi
done