summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/cron/cron.8
blob: afd618cf6be751f5d42ba8d857cddc9d47cb1cf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.\"/* Copyright 1988,1990,1993 by Paul Vixie
.\" * All rights reserved
.\" *
.\" * Distribute freely, except: don't remove my name from the source or
.\" * documentation (don't take credit for my work), mark your changes (don't
.\" * get me blamed for your possible bugs), don't alter or remove this
.\" * notice.  May be sold if buildable source is provided to buyer.  No
.\" * warrantee of any kind, express or implied, is included with this
.\" * software; use at your own risk, responsibility for damages (if any) to
.\" * anyone resulting from the use of this software rests entirely with the
.\" * user.
.\" *
.\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
.\" * I'll try to keep a version up to date.  I can be reached as follows:
.\" * Paul Vixie          <paul@vix.com>          uunet!decwrl!vixie!paul
.\" */
.\" 
.\" $FreeBSD$
.\" 
.Dd December 20, 1993
.Dt CRON 8
.Os
.Sh NAME
.Nm cron
.Nd daemon to execute scheduled commands (Vixie Cron)
.Sh SYNOPSIS
.Nm
.Op Fl s
.Op Fl x Ar debugflag Ns Op ,...
.Sh DESCRIPTION
.Nm Cron
should be started from
.Pa /etc/rc
or
.Pa /etc/rc.local .
It will return immediately,
so you don't need to start it with '&'.
.Pp
.Nm Cron
searches
.Pa /var/cron/tabs
for crontab files which are named after accounts in
.Pa /etc/passwd ;
crontabs found are loaded into memory.
.Nm Cron
also searches for
.Pa /etc/crontab
which is in a different format (see
.Xr crontab 5 ) .
.Nm Cron
then wakes up every minute, examining all stored crontabs, checking each
command to see if it should be run in the current minute.  When executing
commands, any output is mailed to the owner of the crontab (or to the user
named in the
.Ev MAILTO
environment variable in the crontab, if such exists).
.Pp
Additionally,
.Nm
checks each minute to see if its spool directory's modtime (or the modtime
on
.Pa /etc/crontab )
has changed, and if it has,
.Nm
will then examine the modtime on all crontabs and reload those which have
changed.  Thus
.Nm
need not be restarted whenever a crontab file is modified.  Note that the
.Xr crontab 1
command updates the modtime of the spool directory whenever it changes a
crontab.
.Pp
Available options:
.Bl -tag -width indent
.It Fl s
Enable special handling of the switching between the standard time and
daylight saving time.
.Pp
If the time zone has daylight saving time which differs by one hour from
the standard time and the switch to and from daylight saving time occurs
at :00 minutes (as in most of the world with very few exceptions) then these
time switches would be handled specially by 
.Nm cron .
The time zones with other variations of daylight saving time (such as with
30 minutes difference or switched at :30 minutes etc.) do not have such
support.
.Pp
In the supported time zones the jobs run during the switches to and
from daylinght saving time as 
intuitively expected. If a job falls
into a time interval that disappears during the switch from
standard time to daylight saving time or is
duplicated during the reverse switch, then it's handled
in one of two ways. The jobs that run every hour work
as always, they skip the skipped hour or run in the added
hour as usual. But the jobs that run less frequently
are executed exactly once, they are not skipped nor
executed twice (unless cron is restarted or the user's
.Xr crontab 5
is changed during such a time interval). If an hour disappears
during the switch to daylight saving time, such jobs are
executed during the next hour at the first minute that is specified 
for them in
.Xr crontab 5 .
.El
.Sh SEE ALSO
.Xr crontab 1 ,
.Xr crontab 5 
.Sh AUTHORS
.An Paul Vixie Aq paul@vix.com
OpenPOWER on IntegriCloud