cron

The purpose of this document is to describe good uses of cron.

SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # .---------------- Min (0 - 59) # | .------------- Hr (0 - 23) # | | .---------- DOM (1 - 31) # | | | .------- Mon (1 - 12) # | | | | .---- DOW (0 - 6) # | | | | | # Min Hr DOM Mon DOW User Command * 5 * * * root /opt/jgs/jetty/restart.sh */5 * * * * root /opt/jgs/scripts/download.sh >> /var/log/jgs/download.log 2>&1 * 0 * * * root find /var/egressed/*.* -mtime +7 -delete # Safe delete for files exactly in /var/index/ that look like *.tar.gz and are 10 or more days old 0 0 * * * root find /var/index/ -maxdepth 1 -mindepth 1 -name *.tar.gz -type f -mtime +10 -delete

Note: it is always important to have a newline at the end of your crontab files.

[Edit]