Thanks for your quick replies! It's no problem for me to read german if that would help other users in this forum.
Here is the contribution (Lösung) I promised:
Instead of Zeitplaner I use a script to run synOCR whenever a file is changed (created by scanner) in the source folder, it uses the watchmedo programme as described in the ocrmypdf documentation.
It requires some skills since you need to install watchmedo via command-line SSH login (
at least I dont know how to do it in the DSM/browser?) following this procedure:
Please note that you must only use this at your own risk, since I'm not a programmer and I don't have any other experience in Lunix.
If there are any experts around, please let me know if you see any risks in using these scripts
Also do not expect much of my support when trying this yourself, but of course I will reply in this forum if I can think of anything usefull.
I figured this out by just googling a lot, trying a lot, and googling again for my errors.
-pip must be installed, possibly this is allready the case if python is installed (else see
http://pip.pypa.io/en/stable/installing/)
Make sure you stick to the right version of pip, I remember having issues mixing up pip and pip3. I guess both are okay, but just use the same for every command?
-install watchmedo:
http://github.com/gorakhargosh/watchdog#installation
Place a file like this on your NAS:
Rich (BBCode):
#!/bin/sh
watchmedo /volume1/your/scan/folder shell-command -p'*.pdf' -c'ocrmanage.sh' -c'echo "starting ocrmanage.sh"' --drop
# don't forget the final dot
Don't forget to change your/scan/folder to the folder you scan your PDF's to!
You can place this script in any folder your like, it doesn't have to be the folder with PDF's, perhaps it's better to use a folder like volume1/myscripts for it. You can name the file whatever you want, i "use watchfolder.sh":
Then place a second script in the same folder as the first script, call it "ocrmanage.sh"
Rich (BBCode):
#!/bin/bash
echo "ocrmanage has started"
while [ -e "/volume1/documenten/administratie/scans/preocr/*.pdf"]; do
echo "synOCR is started"
/usr/syno/synoman/webman/3rdparty/synOCR/synOCR-start.sh
wait
echo "synOCR is done"
done
echo "ocrmanage is done"
Both scripts should be made executeable (
chmod 755?)
Then via DSM control panel->task schedule create a task to start the first script on every startup of you NAS
Then activate the task once (so you don't need to restart your NAS)
The first script will activate watchmedo.
Watchmedo wil recognize new pdf uploads in the specified folder and start the second script. You can continue to add new scans.
Meanwhile the second script wil start synOCR for all pdf's in the folder, after synOCR it will rescan the folder for PDF's that where put there while synOCR was busy, it wil restart untill the folder stays empty.
It should be running fine now for a single folder.
You can not use it for 2 folders at once I think, you will get an error that synOCR is allready running.
This could possibly be solved:
-by adding watchmedo tasks in the first script
-and in the second script:
checking if synOCR is allready running before running it again,
and restarting synOCR as long as PDF's exist in any of all the folders to be watched.