LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Check folder for specific files than move script (https://www.linuxquestions.org/questions/programming-9/check-folder-for-specific-files-than-move-script-844675/)

BlackCrowe 11-16-2010 02:12 PM

Check folder for specific files than move script
 
I have a script that checks a folder for zip files than moves them to a different folder. I want to check every 5 maybe 10 seconds and since cron is setup to run at least a 1 minute increment I'm not sure how to do that time check as probably a loop within the script.

One other thing is once the time check is in the script how would a cron job be setup to run this script? Once the script is running cron doesn't need to run it again, is there a feature to check if it's running and if it's not then run it?

find /export/xxxshare -name "*.zip" -exec mv {} /export/store \;

rustek 11-16-2010 03:19 PM

This sounds like a job for incrontab rather than crontab, I use incrontab for lots of things and it works great.

See:
http://www.howtoforge.com/triggering...es-with-incron

catkin 11-16-2010 09:36 PM

Two more good inotify/incron introductions here and here.

BlackCrowe 11-23-2010 05:59 AM

Decided running a cronjob every minute would be sufficient.


All times are GMT -5. The time now is 01:49 AM.