- You can't split a crontab line into multiple lines.
(But see note about
%characters in the command part of a crontab line.)
- You can't override
VAR=VALUEwill not perform any expansion on the RHS.
- You can't write trailing comments (via
# comment) on a
VAR=VALUEor a cron command line. They have to be on a line by themselves.
Several environment variables are set up automatically by the cron
daemon. You can override all except
LOGNAME by writing
lines of the form
NOTE: The RHS is not expanded by the shell so you can't refer to other variables or expect other forms of expansion to work.
||Initially set to some system default value. If you want your own custom
||specifies the time zone specific for the cron table. The user should enter a time according to the specified time zone into the table. The time used for writing into a log file is taken from the local time zone, where the daemon is running.|
||allows delaying job startups by random amount of minutes with upper limit specified by the variable. The random scaling factor is determined during the cron daemon startup so it remains constant for the whole run time of the daemon.|
||CSV of email addresses to send the output of cron jobs. Used if a mail needs to be sent. If
||The content-type to use for cron output emails.|
||The charset to use for cron output emails.|
Specifying the command
% characters in the command part of a crontab line are
\n (newline) characters unless escaped by a
backslash character (
\) and all data after the first
will be sent to the command as standard input.
Special / shorthand time extensions
You can replace the first 5 fields that specify the time with one of these shorthands.
||Run once, at startup.|
||Run once a year,
||Run once a month,
||Run once a week,
||Run once a day,
||Run once an hour,
Specifying the times
The time and date fields are:
|day of month||1-31|
|month||1-12 (or names, see below)|
|day of week||0-7 (0 or 7 is Sunday, or use names)|
A field may contain an asterisk (
*), which always stands for
Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive.
Lists are allowed. A list is a set of numbers (or ranges) separated
by commas. Examples:
Step values can be used in conjunction with ranges. Following a
"/<number>" specifies skips of the number's value through
the range. For example,
"0-23/2" can be used in the 'hours' field to
specify command execution for every other hour (the alternative in
the V7 standard is
"0,2,4,6,8,10,12,14,16,18,20,22"). Step values
are also permitted after an asterisk, so if specifying a job to be
run every two hours, you can use
Names can also be used for the 'month' and 'day of week' fields. Use the first three letters of the particular day or month (case does not matter). Ranges or lists of names are not allowed.
The "sixth" field (the rest of the line) specifies the command to be
run. The entire command portion of the line, up to a newline or a
"%" character, will be executed by /
bin/sh or by the shell specified
SHELL variable of the cronfile.
% characters are
replaced by newlines as described in the
Note: The day of a command's execution can be specified in the
following two fields — 'day of month', and 'day of week'. If both
fields are restricted (i.e., do not contain the
"*" character), the
command will be run when either field matches the current time. For
"30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st
and 15th of each month, plus every Friday.
# .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .----- day of week (0 - 7) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * command to be executed