This contains links to information used in the lectures.
Old versions of cron periodically scanned the crontabs. Newer ones parse the crontabs and sleep until the time of the soonest. On ATT-like systems (SunOS, HP-UX) crontab tells cron to reread the crontabs. On some systems sending cron a hangup causes rereading.
cron can be made to log, on HP-UX to /usr/lib/cron/log under 9.X, to /var/adm/cron/log under 10.X and to the system log under SunOS.
minute hour monthday month weekday command
The first five are integer patterns that specify when the sixth field,
command, should be executed. They can have the following ranges of
values:
minute The minute of the hour, 0-59
hour The hour of the day, 0-23
monthday The day of the month, 1-31
month The month of the year, 1-12
weekday The day of the week, 0-6, 0=Sunday
0 0 1,15 * 1 command
runs command at midnight on the first and fifteenth of each month, as
well as every Monday. To specify days in only one field, set the
other field to asterisk (*). For example,
0 0 * * 1 command
runs command only on Mondays.
The sixth field, command (the balance of a line including blanks in a
crontab file), is a string that is executed by the shell at the
specified times. A percent character (%) in this field (unless
escaped by a backslash (\)) is translated to a newline character,
dividing the field into "lines". Only the first "line" (up to a % or
end-of-line) of the command field is executed by the shell. Any other
"lines" are made available to the command as standard input.
On HP-UX cron invokes the command from the user's HOME directory with
the POSIX
shell, (/usr/bin/sh).
cron supplies a default environment for every shell, defining:
HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh