[OpenIndiana-discuss] Cron best practice

Jim Klimov jimklimov at cos.ru
Tue May 15 22:37:53 UTC 2012


2012-05-15 0:26, Robbie Crash wrote:
> The thing I'm unsure of is if it's best practice to get cron to perform the
> task, or if it's better to get cron to call a script.

If you mean cron one-liners growing into three-line scripts,
that's about as far as I allow them to grow - and that if most
of the line is parameters to some command(s) it ultimately calls.

It is indeed somewhat harder to track down from cron into scripts,
but much easier to maintain/develop/debug/enhance the scripts and
keep them in some CVS/SVN/... service to reuse between servers.

There is also a matter of large jobs taking a random amount of
time (i.e. due to some intermittent network hickups, or hight CPU
usage from other tasks), and cron'ed jobs begin to overlay one
another contributing to the system lags. It is easier to implement
anti-overlay locking in a script (so that it exits quickly if an
instance is already running).

HTH,
//Jim



More information about the OpenIndiana-discuss mailing list