3 crontab \- table of jobs to be performed by cron
10 /var/opt/\fIname\fP/lib/crontab\ \ \fR(Minix-vmd only)\fB
11 /usr/spool/crontabs/\fIuser\fP
17 daemon runs jobs at regular intervals. These jobs are listed in
19 files. The format of entries in a crontab file are five fields of numbers
20 specifying the minute (0\-59), hour (0\-23), day of the month (1\-31), month
21 (1\-12), and day of the week (0\-6 with 0 = Sunday) that a task must be
22 executed. The task to be executed follows as a shell command.
24 The time numbers can be given as a comma separated list of simple numbers,
25 ranges ("2\-5" is the same as "2,3,4,5"), and repeats ("2:5" means
26 "2,7,12,17,22" in the hour field). A repeat is cyclic affair, i.e. 2:5
27 and 12:5 are the same thing. A single "*" can be used in a field to
28 indicate all valid numbers in that field, so it translates to "always". In
29 the minute field you can use "?" for the current minute that the crontab
30 file is loaded. It can be used in a repeat, i.e. "?:10" for every 10
31 minutes. This keeps machines with identical crontabs from executing tasks
32 at exactly the same time, causing a burst of traffic if anything is done
35 If a given time is valid in all five fields then a command is executed.
36 Here are a few examples that illustrate the possibilities:
41 # min hour mday mon wday command
42 ? 3 * * * /usr/etc/daily # Daily system cleanup
43 0 * * * * date # Print date on the hour
44 30 4 * * 2\-6 /var/etc/backup # After workdays on 4:30
45 0 9 25 12 * \-u ast sing # Andy sings on Xmas morning
46 0 0 13 * 5 echo Beware! # For the superstitious
51 The command may optionally be prefixed by
53 to specify under which user the command should be run. Commands from
54 crontabs in the spool directory are always run under the id of the crontab's
59 A command can be placed on the same line as the time fields, or on the next
60 line indented by one TAB character. (A TAB, not eight spaces.) More TAB
61 indented lines can be added for a multiline command. The tabs are removed
62 from the command when passed to the shell. If a command is put on the same
63 line as the time fields then percent characters are changed into newlines,
64 this is not done for a TAB indented command. The following three entries
71 0 12 * * * echo 'Hello'; echo ' World!'
73 0 12 * * * echo 'Hello% World!' #2
83 Comments start with a "#" character and continue until end of line. They,
84 excess whitespace, and empty lines are ignored. Of the comments in the
85 example above #1 and #3 are ignored by
87 but #2 and #4 are not recognized as comments, but are seen as part of a
88 command and are passed to the shell who then happens to ignore them. There
89 is no interpretation of command characters other than the percent in a
90 oneliner. The time fields must all be on the same line.
94 Main MINIX 3 crontab file.
96 .B /usr/local/lib/crontab
97 Local jobs for all systems in an organization.
100 System specific jobs.
102 .B /var/opt/\fIname\fP/lib/crontab
103 Per package jobs for Minix-vmd.
106 List of installed packages.
108 .B /usr/spool/crontabs/\fIuser\fP
114 The "?" in the minute field, the repeat field (e.g. "2:5"), TAB indented
115 multiline commands and the
117 option are unique to this cron implementation. This doesn't mean you
118 shouldn't use these features, but just that you should be aware of the
119 differences with other systems. You are even advised to use these features
120 and avoid the percent hack for multiline commands.
122 Other crons allow one to specify input to a job in some way, something this
123 cron can't. Simply use the << shell feature to do that. Other crons often
124 choke on empty lines.
126 It is a common bug to use 0 for Sunday instead of 7. This cron, like most
127 other crons out there accepts this without comment.
129 A job is not reissued until a previous instance of it has exited. The next
130 time to execute is computed from the previous time it ran. If job issuing
131 lags behind on the system time then the next time to run it is computed from
132 the current system time.
134 Kees J. Bot (kjb@cs.vu.nl)
137 .\" $PchId: crontab.5,v 1.3 2000/07/17 18:53:05 philip Exp $