Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently confronted with a cron file that contains a dozen different applications' tasks--some have only one, some have lots. I'm trying to figure out a good way to organize and document these processes. Are there any conventions out there that I could emulate or am I stuck making something up?

share|improve this question
#minute hour    mday    month   wday    who     command

## Acme Anvil Application
# clear logs every 5 minutes
*/5     *       *       *       *       root    /path/to/clear_logs
# monthly maintenance
30      5       1       *       *       root    /path/to/acme/maintenance

## Fabricam
# adjust timing
*/30    0-5     *       *       *       fab    /path/to/bin/fab_time

## Etc...
share|improve this answer

If your system supports /etc/cron.d, you may also try breaking up the cron jobs into individual files, grouped by application.

root@linuxbox:/etc/cron.d# ls
sa-update  sysstat  vnstat

Note that the format of cron jobs in /etc/cron.d is a little different, in that you would put the user running the command in between the time fields and the command itself, e.g.,

root@linuxbox:/etc/cron.d# cat sa-update
### OPTIONAL: Spamassassin Rules Updates ###
# Highly recommended that you read the documentation before using this.
# /var/log/sa-update.log contains a history log of sa-update runs

10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log
share|improve this answer

I would recommend ensuring that you have a comment at the end of your /etc/crontab file. Many implementations of cron won't fire off the last job in the file if it's not terminated with a Line Feed.

Debian Lenny being one of them.

share|improve this answer
Interesting point. I edit my crontab with vim, which won't let me create a text file without a terminating newline unless I ask it very nicely. (Text files without a newline on the last line can cause a lot of problems.) – Keith Thompson Jan 19 '12 at 1:24
Sadly, not everyone uses Vi..... – Magellan Jan 19 '12 at 2:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.