

Recommended Cron Practices (SysAdvent Day 8) - keyist
http://sysadvent.blogspot.com/2009/12/cron-practices.html

======
spuz
My tip when using cron: Use comments liberally. Say what the command is doing,
where to find out more information and write your name so that when I open up
the crontab on some system I can actually find out what it is supposed to be
doing. Comments are essential in a script which is not under any version
control and is shared by many different users.

~~~
ulysses
Your crontabs (as well as all other config files) should be under some form of
version control.

~~~
weaksauce
Along those lines is etckeeper:

[http://fnords.wordpress.com/2009/03/05/etckeeper-
chronicles-...](http://fnords.wordpress.com/2009/03/05/etckeeper-
chronicles-4/)

Edit: if you are worried about your crontab files from users then version
/var/spool/cron/

------
sapphirecat
What you really want is a scheduler that can handle all this for you, so you
don't have to write the same management gunk into every script you run with
cron.

It would also be nice to be able to express "the first Saturday of each month"
for backup jobs, so you don't have to run a script every Saturday which
carefully avoids doing work after the 7th.

~~~
blasdel
That scheduler is called launchd -- it cleanly replaces all of the
"automatically launch a process" tools: not just init and cron (along with
many greenspun variants), but also event-triggered stuff like xinetd and udev.
It even implements the interfaces of its predecessors, so you don't need to
run legacy daemons.

It was written by Apple for 10.4, and the code is real pretty:
<http://launchd.macosforge.org/>

