cron / crontab

Cron is a tool used to automate tasks at a specified time. Crontab is the individual file (per user) that cron accesses.

Sample crontab:

@reboot /bin/sleep 60 && /usr/local/bin/fetchmail >/dev/null 2>&1
*/10 * * * * /usr/local/bin/fetchmail >/dev/null 2>&1

The first line:
“At reboot, sleep for 60 seconds, then run ‘fetchmail’, and output stdout to /dev/null.” By default, cron emails the root user output after crontab completion.

The second line:
“Every 10 minute interval for every hour, all days, all weeks, all months, run fetchmail, and output stdout in /dev/null.”

*/10 * * * * /usr/local/bin/fetchmail >/dev/null 2>&1
 ^   ^ ^ ^ ^ {_________^____________} {______^_______}
 |   | | | |           |                     |
 |   | | | |           |               stdout to /dev/null
 |   | | | |           |
 |   | | | |    command to run
 |   | | | |
 |   | | | all months
 |   | | |
 |   | | all weeks
 |   | |
 |   | all days
 |   |
 |   all hours
 |
 all minutes divided by 10 (or every :X0) ie, 6:10, 6:20, etc