How to write a loop command for pdf2djvu
How do I write a loop command to periodically check a given folder and then create a djvu file from any pdf it finds.
pdf2djvu works great but I'm looking to set up a "hot folder" for general office staff to use. |
Well in my opinion this is what cron is for, you can just have the script to look in to that folder for new files or modified within X amount of time and convert it, then setup the crontab of the user that will execute it every X amount of minutes, days or whatever you need.
|
Which languages can you use? Can you call inotify?
|
This is what I have so far.
It works great except if it kick's in while someone is uploading a pdf file. The pdf gets deleted before it's processed. find /home/qwikchk/ -iname '*.pdf' -print0 | xargs -0 -IX pdf2djvu -o X.djvu X mv /home/qwikchk/*.djvu /var/www/html/qwikchk/files/ rm -f /home/qwikchk/*.pdf chown -R apache:apache /var/www/html/qwikchk/ |
All times are GMT -5. The time now is 03:19 PM. |