xref: /openbsd/usr.sbin/cron/cron.8 (revision 133306f0)
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.\" $Id: cron.8,v 1.8 2000/03/19 17:57:03 aaron Exp $
19.\"
20.Dd June 6, 1999
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 cron
28.Sh DESCRIPTION
29.Nm
30should be started from
31.Pa /etc/rc
32or
33.Pa /etc/rc.local .
34It will return immediately, so you don't need to start it with
35.Ql \&& .
36.Pp
37.Nm
38searches its spool directory
39.Pf ( Pa /var/cron/tabs Ns )
40for
41.Xr crontab 5
42files which are named after accounts in
43.Pa /etc/passwd ;
44crontabs found are loaded into memory.
45.Nm
46also searches for
47.Pa /etc/crontab
48which is in a different format (see
49.Xr crontab 5 ) .
50.Nm
51then wakes up every minute, examining all loaded crontabs, checking each
52command to see if it should be run in the current minute.
53When executing commands, any output is mailed to the user named in the
54.Ev MAILTO
55environment variable in the crontab, or to the owner of the crontab if
56.Ev MAILTO
57is not present.
58.Pp
59Additionally,
60.Nm
61checks each minute to see if its spool directory's modtime (or the modtime on
62.Pa /etc/crontab )
63has changed, and if it has,
64.Nm
65examines the modtime on all crontabs and reloads those which have
66changed.
67Thus
68.Nm
69need not be restarted whenever a crontab file is modified.
70Note that the
71.Xr crontab 1
72command updates the modtime of the spool directory whenever it changes a
73crontab.
74.Pp
75Special considerations exist when the clock is changed by less than 3
76hours; for example, at the beginning and end of Daylight Saving
77Time.
78If the time has moved forward, those jobs which would have
79run in the time that was skipped will be run soon after the change.
80Conversely, if the time has moved backward by less than 3 hours,
81those jobs that fall into the repeated time will not be run.
82.Pp
83Only jobs that run at a particular time (not specified as @hourly, nor with
84.Ql *
85in the hour or minute specifier)
86are
87affected.
88Jobs which are specified with wildcards are run based on the
89new time immediately.
90.Pp
91Clock changes of more than 3 hours are considered to be corrections to
92the clock, and the new time is used immediately.
93.Sh SEE ALSO
94.Xr crontab 1 ,
95.Xr crontab 5
96.Sh AUTHOR
97Paul Vixie <paul@vix.com>
98