.TH CRONTAB 5 .SH NAME crontab \- table of jobs to be performed by cron .SH SYNOPSIS .nf .ft B /usr/lib/crontab /usr/local/lib/crontab /var/lib/crontab /var/opt/\fIname\fP/lib/crontab\ \ \fR(Minix-vmd only)\fB /usr/spool/crontabs/\fIuser\fP .ft R .fi .SH DESCRIPTION The .BR cron (8) daemon runs jobs at regular intervals. These jobs are listed in .B crontab files. The format of entries in a crontab file are five fields of numbers specifying the minute (0\-59), hour (0\-23), day of the month (1\-31), month (1\-12), and day of the week (0\-6 with 0 = Sunday) that a task must be executed. The task to be executed follows as a shell command. .PP The time numbers can be given as a comma separated list of simple numbers, ranges ("2\-5" is the same as "2,3,4,5"), and repeats ("2:5" means "2,7,12,17,22" in the hour field). A repeat is cyclic affair, i.e. 2:5 and 12:5 are the same thing. A single "*" can be used in a field to indicate all valid numbers in that field, so it translates to "always". In the minute field you can use "?" for the current minute that the crontab file is loaded. It can be used in a repeat, i.e. "?:10" for every 10 minutes. This keeps machines with identical crontabs from executing tasks at exactly the same time, causing a burst of traffic if anything is done over a network. .PP If a given time is valid in all five fields then a command is executed. Here are a few examples that illustrate the possibilities: .PP .if t .RS .if t .ft C .nf # min hour mday mon wday command ? 3 * * * /usr/etc/daily # Daily system cleanup 0 * * * * date # Print date on the hour 30 4 * * 2\-6 /var/etc/backup # After workdays on 4:30 0 9 25 12 * \-u ast sing # Andy sings on Xmas morning 0 0 13 * 5 echo Beware! # For the superstitious .fi .if t .ft P .if t .RE .PP The command may optionally be prefixed by .BI \-u " user" to specify under which user the command should be run. Commands from crontabs in the spool directory are always run under the id of the crontab's owner, the .B \-u flag is ignored. .PP A command can be placed on the same line as the time fields, or on the next line indented by one TAB character. (A TAB, not eight spaces.) More TAB indented lines can be added for a multiline command. The tabs are removed from the command when passed to the shell. If a command is put on the same line as the time fields then percent characters are changed into newlines, this is not done for a TAB indented command. The following three entries give the same output: .PP .RS .if t .ft C .nf .ta +8n 0 12 * * * echo 'Hello'; echo ' World!' #1 0 12 * * * echo 'Hello% World!' #2 0 12 * * * #3 cat <