Reputation: 925
I have a Perl script that needs to run following an annual schedule with specific dates and times of when to start and stop. I don't believe crontab can handle this. Is there a Perl module (even a non-perl implementation would be fine) that can help me with this? If it helps, I m running this on a linux box.
Also, the schedule has only 15-20 aberrations (days on which the process must start and stop at a different time).
Upvotes: 1
Views: 567
Reputation: 45371
Couldn't a cron job trigger twice; once to start and once to stop? with a pid
file in a known location you can handle this easily. Also when there's schedule changes, just create too many cron jobs that cover the regular times and the different times, then have the job check to see if this is a valid time to start.
Upvotes: 2
Reputation: 67048
I usually find that the best way to handle this is to set up cron with an easy superset of the needed dates (every day, or every hour, whatever) and have the script itself determine if it's the right time to run. If not, just exit
before you do anything.
Upvotes: 12
Reputation: 1771
You might try fcron. It handles down systems, starting jobs based on system load, and e-mails you if a job doesn't run. Most Linux distributions should already have a package for it.
Upvotes: 1