|laziness, impatience, and hubris|
Of cron job managementby jimbus (Friar)
|on Aug 22, 2006 at 15:29 UTC||Need Help??|
jimbus has asked for the
wisdom of the Perl Monks concerning the following question:
I've got a Perl script that runs via cron every 15 minutes and it does this pretty happily. I need to make some changes so that the system is more self-recovering in the event of a network outage or something that prevents the reporting system from getting the files it needs to process. The problem is I'm concerned that it could easily end up running longer than its window when trying to recover and ended up with multiple instances competing.
I'd like to get some input on how to manage this... Should I have a fixed time for the script to execute? Should the next instance tell the previous to clean up and exit gracefully? Should I let the first one finish its natural course and cancel new ones until it is done?
My vision is to have each instance do what it can to catch things up and exit before/as the next one starts, but I'm not sure how best to go about that.
--Jimbus aka Jim Babcock
Wireless Data Engineer and Geek Wannabe