I have a perl script that does polling a file's existence in every 600 seconds before it goes on to finish its task. I am using crontab to schedule my script. I wonder is there an event system on linux that I could register my perl script so that system does the call-back if the file exists?

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

Check out http://search.cpan.org/~mlehmann/Linux-Inotify2-1.2/Inotify2.pm (Linux::Inotify2 - scalable directory/file change notification).

Also check out incron

It consists of a daemon and a table manipulator. You can use it a similar way as the 
regular cron. The difference is that the inotify cron handles filesystem events rather 
than time periods.
link|improve this answer
feedback

Inotify should be your friend for this one... . There seem to be perl bindings as well. Your kernel needs to support this though... .

link|improve this answer
feedback

Your Answer

 
or
required, but never shown