[Gllug] Advanced versions of cron for scheduling
Richard Jones
rich at annexia.org
Fri Jul 15 18:48:07 UTC 2005
We are currently using cron to schedule batch jobs which must be run
at certain times of the day, but we're starting to hit limits with
this approach. So as a result we're casting around looking for a
"better cron".
Some of the things we'd like to do, but cron makes unnecessarily
difficult:
(1) Run one job straight after another/some others have finished.
This can be done using script1 && script2, but what if we want a job
to run after several other jobs have finished, provided they all
finish successfully. And in a maintainable fashion.
(2) Run a job continually - after it finishes, schedule it to run
again.
A shell script, while true; do ... done, solves this, but there are
maintainability concerns (eg for one, how to start the script when the
machine boots, from a non-root user account, without requiring root
access?).
(3) Set a time limit on a job.
If it exceeds the time limit, either send mail warning about this, or
kill it -- we'd want to control which, because sometimes killing a job
can result in loss of data, for reasons outside of our control.
(4) Running jobs regularly, but at odd intervals.
For example, one request I've had was to run a job every 45 minutes.
This isn't easy to express in a crontab.
(5) Keep the crontab file under CVS control.
(6) Ensure only one job is running at once.
At the moment we're using lock files stored in $HOME.
I've looked at launchd (ugly, undocumented XML syntax, and doesn't do
half the stuff we want anyway), and at this slashdot article
[http://ask.slashdot.org/article.pl?sid=05/05/13/0225245] but we
haven't really found anything suitable yet.
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list