Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / cron / cron / cron.8
1 .\"/* Copyright 1988,1990,1993 by Paul Vixie
2 .\" * All rights reserved
3 .\" *
4 .\" * Distribute freely, except: don't remove my name from the source or
5 .\" * documentation (don't take credit for my work), mark your changes (don't
6 .\" * get me blamed for your possible bugs), don't alter or remove this
7 .\" * notice.  May be sold if buildable source is provided to buyer.  No
8 .\" * warrantee of any kind, express or implied, is included with this
9 .\" * software; use at your own risk, responsibility for damages (if any) to
10 .\" * anyone resulting from the use of this software rests entirely with the
11 .\" * user.
12 .\" *
13 .\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14 .\" * I'll try to keep a version up to date.  I can be reached as follows:
15 .\" * Paul Vixie          <paul@vix.com>          uunet!decwrl!vixie!paul
16 .\" */
17 .\"
18 .\" $FreeBSD: src/usr.sbin/cron/cron/cron.8,v 1.7.2.9 2003/03/11 21:13:48 trhodes Exp $
19 .\"
20 .Dd December 20, 1993
21 .Dt CRON 8
22 .Os
23 .Sh NAME
24 .Nm cron
25 .Nd daemon to execute scheduled commands (Vixie Cron)
26 .Sh SYNOPSIS
27 .Nm
28 .Op Fl s
29 .Op Fl o
30 .Op Fl x Ar debugflag Ns Op , Ns Ar ...
31 .Sh DESCRIPTION
32 The
33 .Nm
34 utility should be started from
35 .Pa /etc/rc
36 or
37 .Pa /etc/rc.local .
38 It will return immediately,
39 so you don't need to start it with '&'.
40 .Pp
41 The
42 .Nm
43 utility searches
44 .Pa /var/cron/tabs
45 for crontab files which are named after accounts in
46 .Pa /etc/passwd ;
47 crontabs found are loaded into memory.
48 The
49 .Nm
50 utility also searches for
51 .Pa /etc/crontab
52 which is in a different format (see
53 .Xr crontab 5 ) .
54 The
55 .Nm
56 utility
57 then wakes up every minute, examining all stored crontabs, checking each
58 command to see if it should be run in the current minute.  When executing
59 commands, any output is mailed to the owner of the crontab (or to the user
60 named in the
61 .Ev MAILTO
62 environment variable in the crontab, if such exists).
63 .Pp
64 Additionally,
65 .Nm
66 checks each minute to see if its spool directory's modification time (or
67 the modification time on
68 .Pa /etc/crontab )
69 has changed, and if it has,
70 .Nm
71 will then examine the modification time on all crontabs and reload those
72 which have changed.  Thus
73 .Nm
74 need not be restarted whenever a crontab file is modified.  Note that the
75 .Xr crontab 1
76 command updates the modification time of the spool directory whenever it
77 changes a crontab.
78 .Pp
79 Available options:
80 .Bl -tag -width indent
81 .It Fl s
82 Enable special handling of situations when the GMT offset of the local
83 timezone changes, such as the switches between the standard time and
84 daylight saving time.
85 .Pp
86 The jobs run during the GMT offset changes time as
87 intuitively expected.
88 If a job falls into a time interval that disappears
89 (for example, during the switch from
90 standard time) to daylight saving time or is
91 duplicated (for example, during the reverse switch), then it's handled
92 in one of two ways:
93 .Pp
94 The first case is for the jobs that run every at hour of a time interval
95 overlapping with the disappearing or duplicated interval.
96 In other words, if the job had run within one hour before the GMT offset change
97 (and cron was not restarted nor the
98 .Xr crontab 5
99 changed after that)
100 or would run after the change at the next hour.
101 They work as always, skip the skipped time or run in the added
102 time as usual.
103 .Pp
104 The second case is for the jobs that run less frequently.
105 They are executed exactly once, they are not skipped nor
106 executed twice (unless cron is restarted or the user's
107 .Xr crontab 5
108 is changed during such a time interval).
109 If an interval disappears
110 due to the GMT offset change, such jobs are
111 executed at the same absolute point of time as they would be in the
112 old time zone.
113 For example, if exactly one hour disappears, this
114 point would be during the next hour at the first minute that is
115 specified for them in
116 .Xr crontab 5 .
117 .It Fl o
118 Disable the special handling of situations when the GMT offset of the local
119 timezone changes, to be compatible with the old (default) behavior.
120 If both options
121 .Fl o
122 and
123 .Fl s
124 are specified, the option specified last wins.
125 .It Fl x Ar debugflag Ns Op , Ns Ar ...
126 Enable writing of debugging information to standard output.
127 One or more of the following comma separated
128 .Ar debugflag
129 identifiers must be specified:
130 .Pp
131 .Bl -tag -width ".Cm proc" -compact
132 .It Cm bit
133 currently not used
134 .It Cm ext
135 make the other debug flags more verbose
136 .It Cm load
137 be verbose when loading crontab files
138 .It Cm misc
139 be verbose about miscellaneous one-off events
140 .It Cm pars
141 be verbose about parsing individual crontab lines
142 .It Cm proc
143 be verbose about the state of the process, including all of its offspring
144 .It Cm sch
145 be verbose when iterating through the scheduling algorithms
146 .It Cm test
147 trace through the execution, but do not perform any actions
148 .El
149 .El
150 .Sh SEE ALSO
151 .Xr crontab 1 ,
152 .Xr crontab 5
153 .Sh AUTHORS
154 .An Paul Vixie Aq paul@vix.com