<a name=


daemon to execute scheduled commands



How to run the cron daemon: Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'.

What cron does
Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the /etc/cron.d/ directory, which are in a different format (see crontab(5)).

Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute.

Mailing output
When executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists).

Modifying a cron job
Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is mod­ ified. Note that the crontab(1) command updates the mod­ time of the spool directory whenever it changes a crontab.

"If you do not love your job, change it. Instead of pushing paper, push ideas. Instead of sitting down, stand up and be heard. Instead of complaining, contribute. Don't get stuck in a job description" - Microsoft job advert

Related commands:

crontab - Schedule a command to run at a later time
chroot - Run a command with a different root directory
exec - Execute a command
if - Conditionally perform a command
nohup - Run a command immune to hangups
su - Run a command with substitute user and group id
watch - Execute/display a program periodically
.period - Run commands from a file