Making sense of cron in Centos and Fedora Linux
CentOS and Fedora Linux use a set of directories in /etc to control when jobs run. These directories take the following form:
/etc/cron.hourly – jobs that run once per hour
/etc/cron.daily – jobs that run once per day
/etc/cron.weekly – jobs that run one per week
/etc/cron.monthly – jobs that run once per month
To add a job to run hourly, daily, weekly or monthly, you can drop an executable shell script in the pertinent directory. I recently became curious which time of the day daily jobs execute, which day weekly jobs run, and when monthly jobs were scheduled. The answer to these questions comes in the way of /etc/crontab, which contains crontab formatted entries that call the run-parts script to invoke the scripts in the hourly, daily, weekly or monthly directory:
$ more /etc/crontab
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly
If you are familiar with the crontab format, it’s easy enough to decode this information to figure out the days and times when cron jobs will run. Nice!








natxo asenjo on August 22nd, 2009
Just don’t forget to *not* give an extension to the executable you drop there. Or it will not run (this bit me once :-) )