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.\" $DragonFly: src/usr.sbin/cron/cron/cron.8,v 1.3 2006/03/18 20:29:50 dillon Exp $ 20.\" 21.Dd December 20, 1993 22.Dt CRON 8 23.Os 24.Sh NAME 25.Nm cron 26.Nd daemon to execute scheduled commands (Vixie Cron) 27.Sh SYNOPSIS 28.Nm 29.Op Fl j Ar jitter 30.Op Fl J Ar rootjitter 31.Op Fl s 32.Op Fl o 33.Op Fl x Ar debugflag Ns Op , Ns Ar ... 34.Sh DESCRIPTION 35The 36.Nm 37utility should be started from 38.Pa /etc/rc 39or 40.Pa /etc/rc.local . 41It will return immediately, 42so you don't need to start it with '&'. 43.Pp 44The 45.Nm 46utility searches 47.Pa /var/cron/tabs 48for crontab files which are named after accounts in 49.Pa /etc/passwd ; 50crontabs found are loaded into memory. 51The 52.Nm 53utility also searches for 54.Pa /etc/crontab 55which is in a different format (see 56.Xr crontab 5 ) . 57The 58.Nm 59utility 60then wakes up every minute, examining all stored crontabs, checking each 61command to see if it should be run in the current minute. When executing 62commands, any output is mailed to the owner of the crontab (or to the user 63named in the 64.Ev MAILTO 65environment variable in the crontab, if such exists). 66.Pp 67Additionally, 68.Nm 69checks each minute to see if its spool directory's modification time (or 70the modification time on 71.Pa /etc/crontab ) 72has changed, and if it has, 73.Nm 74will then examine the modification time on all crontabs and reload those 75which have changed. Thus 76.Nm 77need not be restarted whenever a crontab file is modified. Note that the 78.Xr crontab 1 79command updates the modification time of the spool directory whenever it 80changes a crontab. 81.Pp 82Available options: 83.Bl -tag -width indent 84.It Fl j Ar jitter 85Enable time jitter. 86Prior to executing commands, 87.Nm 88will sleep a random number of seconds in the range from 0 to 89.Ar jitter . 90This won't affect superuser jobs (see 91.Fl J ) . 92A value for 93.Ar jitter 94must be between 0 and 60 inclusive. 95Default is 0, which effectively disables time jitter. 96.Pp 97This option can help to smooth down system load spikes during 98moments when a lot of jobs are likely to start at once, e.g., 99at the beginning of the first minute of each hour. 100.It Fl J Ar rootjitter 101Enable time jitter for superuser jobs. 102The same as 103.Fl j 104except that it will affect jobs run by the superuser only. 105.It Fl s 106Enable special handling of situations when the GMT offset of the local 107timezone changes, such as the switches between the standard time and 108daylight saving time. 109.Pp 110The jobs run during the GMT offset changes time as 111intuitively expected. 112If a job falls into a time interval that disappears 113(for example, during the switch from 114standard time) to daylight saving time or is 115duplicated (for example, during the reverse switch), then it's handled 116in one of two ways: 117.Pp 118The first case is for the jobs that run every at hour of a time interval 119overlapping with the disappearing or duplicated interval. 120In other words, if the job had run within one hour before the GMT offset change 121(and cron was not restarted nor the 122.Xr crontab 5 123changed after that) 124or would run after the change at the next hour. 125They work as always, skip the skipped time or run in the added 126time as usual. 127.Pp 128The second case is for the jobs that run less frequently. 129They are executed exactly once, they are not skipped nor 130executed twice (unless cron is restarted or the user's 131.Xr crontab 5 132is changed during such a time interval). 133If an interval disappears 134due to the GMT offset change, such jobs are 135executed at the same absolute point of time as they would be in the 136old time zone. 137For example, if exactly one hour disappears, this 138point would be during the next hour at the first minute that is 139specified for them in 140.Xr crontab 5 . 141.It Fl o 142Disable the special handling of situations when the GMT offset of the local 143timezone changes, to be compatible with the old (default) behavior. 144If both options 145.Fl o 146and 147.Fl s 148are specified, the option specified last wins. 149.It Fl x Ar debugflag Ns Op , Ns Ar ... 150Enable writing of debugging information to standard output. 151One or more of the following comma separated 152.Ar debugflag 153identifiers must be specified: 154.Pp 155.Bl -tag -width ".Cm proc" -compact 156.It Cm bit 157currently not used 158.It Cm ext 159make the other debug flags more verbose 160.It Cm load 161be verbose when loading crontab files 162.It Cm misc 163be verbose about miscellaneous one-off events 164.It Cm pars 165be verbose about parsing individual crontab lines 166.It Cm proc 167be verbose about the state of the process, including all of its offspring 168.It Cm sch 169be verbose when iterating through the scheduling algorithms 170.It Cm test 171trace through the execution, but do not perform any actions 172.El 173.El 174.Sh SEE ALSO 175.Xr crontab 1 , 176.Xr crontab 5 177.Sh AUTHORS 178.An Paul Vixie Aq paul@vix.com 179