I sometimes need to remind myself how to edit that crontab file … today I found a great little graphic on the Linuxconfig wiki that sums it up nicely:
Sometimes, I also pipe the stdout and stderr somewhere (like “/usr/local/sbin/backup.sh >>/var/logs/backups.log 2>/var/logs/backups.err“) if I want to avoid getting emails with the output from cron … (although in the example above, which looks like a backup script, I’d probably rather be emailed with a warning that my backups were succeeding or failing).
Thanks Linuxconfig !
Update:
After some FriendFeed discussion, it was noted that the crontab above is a “system crontab”, not the typical “user crontab” you would edit by typing “crontab -e” at the command line. For the “user crontab”, you don’t specify the user (the blue field, “root” in the example above).
I’ve just discovered Roberto Alsina’s blog .. he has a bunch of extremely clear and insightful articles about Linux (and *nix generally).
I particularly like “Making Linux systems that don’t suck: Part II” (and Part I and Part 0), which puts a critical eye to cron and at, and surveys a few good alternatives (some backward compatible, and some not). Read the rest of this entry »