cron - clock daemon
cron [-l load_avg] [-n] [-x
[ext,sch,proc,pars,load,misc,test]]
The cron daemon schedules commands to be run at specified
dates and
times. Commands that are to be run periodically are specified within
crontab(5) files. Commands that are only to be run once are
scheduled
via the at(1) and batch(1) commands. Normally, the cron
daemon is started
from the /etc/rc command script. Because it can execute
commands on a
user's behalf, cron should be run late in the startup sequence, as close
to the time when logins are accepted as possible.
cron loads crontab(5) and at(1) files when it starts up and
also when
changes are made via the crontab(1) and at(1) commands. Additionally,
cron checks the modification time on the system crontab file
(/etc/crontab), the crontab spool (/var/cron/tabs), and the
at spool
(/var/cron/atjobs) once a minute. If the modification time
has changed,
the affected files are reloaded.
Any output produced by a command is sent to the user specified in the
MAILTO environment variable as set in the crontab(5) file
or, if no
MAILTO variable is set (or if this is an at(1) or batch(1)
job), to the
job's owner. If a command produces no output or if the
MAILTO environment
variable is set to the empty string, no mail will be
sent. The exception
to this is at(1) or batch(1) jobs submitted with the
-m flag. In
this case, mail will be sent even if the job produces no
output.
Daylight Saving Time and other time changes [Toc] [Back]
Local time changes of less than three hours, such as those
caused by the
start or end of Daylight Saving Time, are handled specially.
This only
applies to jobs that run at a specific time and jobs that
are run with a
granularity greater than one hour. Jobs that run more frequently are
scheduled normally.
If time has moved forward, those jobs that would have run in
the interval
that has been skipped will be run immediately. Conversely,
if time has
moved backward, care is taken to avoid running jobs twice.
Time changes of more than 3 hours are considered to be corrections to the
clock or timezone, and the new time is used immediately.
The options are as follows:
-l load_avg
If the current load average is greater than
load_avg, batch(1)
jobs will not be run. The default value is 1.5. To
allow
batch(1) jobs to run regardless of the load, a value
of 0.0 may
be used.
-n By default, cron will detach from the current tty
and become a
daemon. The -n option disables this behavior and
causes it to
run in the foreground.
-x debug_flags
If cron was compiled with debugging support, a number of debugging
flags are available to show what cron is doing.
The following
flags may be specified:
ext show extended information; used in conjunction with other
debug flags to provide even more information
sch print information related to scheduling jobs
proc print information related to running processes
pars print information related to parsing
crontab(5) files
load print when loading the databases
misc show misc other debugging information
test test mode; don't actually execute commands
Multiple flags may be specified, separated by a comma (`,'). Regardless
of which flags were specified, the -x flag
will cause
cron to stay in the foreground and not become a daemon.
SIGHUP causes cron to close and reopen its log file. This
is useful in
scripts which rotate and age log files. On OpenBSD
this has no
effect because cron logs via syslog(3).
/etc/crontab system crontab file
/var/cron/atjobs directory containing at(1) jobs
/var/cron/log cron's log file
/var/cron/tabs directory containing individual
crontab files
/var/cron/tabs/.sock used by crontab(1) to tell cron to
check for
crontab changes immediately
at(1), crontab(1), syslog(3), crontab(5)
Paul Vixie <[email protected]>
All crontab(5) files must not be readable or writable by any
user other
than their owner, including /etc/crontab. In practice this
means they
should be mode 0600. This restriction is enforced automatically by
crontab(1) but if /etc/crontab is used, the mode must be set
manually on
that file.
OpenBSD 3.6 July 6, 2002
[ Back ] |