-
Notifications
You must be signed in to change notification settings - Fork 17
/
cron.8
98 lines (98 loc) · 3.75 KB
/
cron.8
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
.\" Copyright 1988,1990,1993,1996,2021 by Paul Vixie ("VIXIE")
.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND VIXIE DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VIXIE BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: cron.8,v 1.8 2004/01/23 19:03:32 vixie Exp $
.\"
.TH CRON 8 "10 January 1996""
.UC 4
.SH NAME
cron \- daemon to execute scheduled commands (Vixie Cron)
.SH SYNOPSIS
.B cron
.RB [ \-M
.IR mailer ]
.RB [ \-n ]
.RB [ \-x
.IR flag [ , ... ] ]
.SH DESCRIPTION
.I Cron
should be started from /etc/rc or /etc/rc.local. It will return immediately,
so you don't need to start it with '&'. The \-n option changes this default
behavior causing it to run in the foreground. This can be useful when
starting it out of init.
.PP
.I Cron
searches /var/cron/tabs for crontab files which are named after accounts in
/etc/passwd; crontabs found are loaded into memory.
.I Cron
also searches for /etc/crontab which is in a different format (see
.IR crontab (5)).
.I 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 MAILTO environment variable in the crontab, if such exists).
.PP
The default mailer command is /usr/sbin/sendmail unless overridden with the
\-M command line option when
.I Cron
is invoked. If exactly one %s is present this command string, it will be
replaced by the user name of the invoking cron tab.
.PP
Additionally,
.I cron
checks each minute to see if its spool directory's modtime (or the modtime
on
.IR /etc/crontab )
has changed, and if it has,
.I cron
will then examine the modtime on all crontabs and reload those which have
changed. Thus
.I cron
need not be restarted whenever a crontab file is modified. Note that the
.IR Crontab (1)
command updates the modtime of the spool directory whenever it changes a
crontab.
.SS Daylight Saving Time and other time changes
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.
.PP
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.
.PP
Time changes of more than 3 hours are considered to be corrections to
the clock or timezone, and the new time is used immediately.
.SH SIGNALS
On receipt of a \s-2SIGHUP\s+2, the cron daemon will close and reopen its
log file. This is useful in scripts which rotate and age log files.
Naturally this is not relevant if cron was built to use
.IR syslog (3).
.SH CAVEATS
In this version of
.BR cron ,
/etc/crontab must not be readable or writable by any user other than root.
In other words, it should be mode 0600.
.SH "SEE ALSO"
.IR crontab (1),
.IR crontab (5)
.SH AUTHOR
.nf
Paul Vixie <[email protected]>