New sentence, new line.
[netbsd-mini2440.git] / usr.sbin / cron / cron.8
blobba7e75ae7e3332d63fbe0cb8d0850595cd866fc3
1 .\"     $NetBSD: cron.8,v 1.7 2004/03/20 18:54:33 wiz Exp $
2 .\"
3 .\"/* Copyright 1988,1990,1993 by Paul Vixie
4 .\" * All rights reserved
5 .\" *
6 .\" * Distribute freely, except: don't remove my name from the source or
7 .\" * documentation (don't take credit for my work), mark your changes (don't
8 .\" * get me blamed for your possible bugs), don't alter or remove this
9 .\" * notice.  May be sold if buildable source is provided to buyer.  No
10 .\" * warrantee of any kind, express or implied, is included with this
11 .\" * software; use at your own risk, responsibility for damages (if any) to
12 .\" * anyone resulting from the use of this software rests entirely with the
13 .\" * user.
14 .\" *
15 .\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
16 .\" * I'll try to keep a version up to date.  I can be reached as follows:
17 .\" * Paul Vixie          <paul@vix.com>          uunet!decwrl!vixie!paul
18 .\" */
19 .\"
20 .\" Id: cron.8,v 2.2 1993/12/28 08:34:43 vixie Exp
21 .\"
22 .Dd December 29, 2007
23 .Dt CRON 8
24 .Os
25 .Sh NAME
26 .Nm cron
27 .Nd daemon to execute scheduled commands (Vixie Cron)
28 .Sh SYNOPSIS
29 .Nm
30 .Op Fl x Ar debugflags
31 .Sh DESCRIPTION
32 .Nm
33 is normally started during system boot by
34 .Xr rc.d 8
35 framework, if cron is switched on in
36 .Xr rc.conf 5 .
37 .Pp
38 .Nm
39 searches
40 .Pa /var/cron/tabs
41 for crontab files which are named after accounts in
42 .Pa /etc/passwd .
43 Crontabs found are loaded into memory.
44 .Nm
45 also searches for
46 .Pa /etc/crontab
47 which is in a different format (see
48 .Xr crontab 5 ) .
49 .Nm
50 then wakes up every minute, examining all stored crontabs, checking each
51 command to see if it should be run in the current minute.
52 When executing commands, any output is mailed to the owner of the
53 crontab (or to the user named in the
54 .Ev MAILTO
55 environment variable in the crontab, if such exists).
56 .Pp
57 Events such as
58 .Dv START
59 and
60 .Dv FINISH
61 are recorded in the
62 .Pa /var/log/cron
63 log file with date and time details.
64 This information is useful for a number of reasons, such as
65 determining the amount of time required to run a particular job.
66 By default, root has an hourly job that rotates these log files
67 with compression to preserve disk space.
68 .Pp
69 Additionally,
70 .Nm
71 checks each minute to see if its spool directory's modtime (or the modtime
73 .Pa /etc/crontab )
74 has changed, and if it has,
75 .Nm
76 will then examine the modtime on all crontabs and reload those which have
77 changed.
78 Thus
79 .Nm
80 need not be restarted whenever a crontab file is modified.
81 Note that the
82 .Xr crontab 1
83 command updates the modtime of the spool directory whenever it changes a
84 crontab.
85 .Pp
86 The
87 .Fl x
88 flag turns on some debugging flags.
89 .Ar debugflags
90 is comma-separated list of debugging flags to turn on.
91 If a flag is turned on,
92 .Nm
93 writes some additional debugging information to system log during
94 its work.
95 Available debugging flags are:
96 .Bl -tag -width proc -compact
97 .It Ar sch
98 scheduling
99 .It Ar proc
100 process control
101 .It Ar pars
102 parsing
103 .It Ar load
104 database loading
105 .It Ar misc
106 miscellaneous
107 .It Ar test
108 test mode - do not actually execute any commands
109 .It Ar bit
110 show how various bits are set (long)
111 .It Ar ext
112 print extended debugging information
114 .Sh FILES
115 .Bl -tag -width /var/cron/tabs -compact
116 .It Pa /var/cron/tabs
118 spool directory
119 .It Pa /etc/crontab
120 system crontab
121 .It Pa /var/log/cron
122 log file for cron events
124 .Sh SEE ALSO
125 .Xr crontab 1 ,
126 .Xr crontab 5
127 .Sh AUTHORS
128 .An Paul Vixie
129 .Aq paul@vix.com