doc -f and -n flags
[unix-history] / usr / src / usr.sbin / cron / cron.8
CommitLineData
f3855db7 1.\" @(#)cron.8 6.4 (Berkeley) %G%
44828dbf 2.\"
f15d0735 3.TH CRON 8 ""
44828dbf
KM
4.AT 3
5.SH NAME
6cron \- clock daemon
7.SH SYNOPSIS
8.B /etc/cron
9.SH DESCRIPTION
10.I Cron
11executes commands at specified dates and times
526abb6f
JL
12according to the instructions in the files
13/usr/lib/crontab and /usr/lib/crontab.local.
14None, either one, or both of these files may be present.
44828dbf
KM
15Since
16.I cron
17never exits,
18it should only be executed once.
19This is best done by running
20.I cron
21from the initialization
22process through the file
23/etc/rc;
24see
25.IR init (8).
26.PP
526abb6f
JL
27The
28crontab files
29consist of lines of seven fields each.
44828dbf 30The fields are separated by spaces or tabs.
f3855db7
KM
31The first five are integer patterns to specify:
32.in +2m
33.TP 2m
34\(bu
35minute (0-59)
36.nr .0 \n()Pu
37.nr )P 0
38.TP 2m
39\(bu
40hour (0-23)
41.TP 2m
42\(bu
43day of the month (1-31)
44.TP 2m
45\(bu
46month of the year (1-12)
47.TP 2m
48\(bu
49day of the week (1-7 with 1 = Monday)
50.nr )P \n(.0u
51.in -2m
52.LP
53Each of these patterns may contain:
54.in +2m
55.TP 2m
56\(bu
57a number in the range above
58.nr .0 \n()Pu
59.nr )P 0
60.TP 2m
61\(bu
62two numbers separated by a minus
63meaning a range inclusive
64.TP 2m
65\(bu
44828dbf 66a list of numbers separated by
f3855db7
KM
67commas meaning any of the numbers
68.TP 2m
69\(bu
70an asterisk meaning all legal values
71.nr )P \n(.0u
72.in -2m
73.LP
526abb6f
JL
74The sixth field is a user name: the
75command will be run ``as'' that user.
0244f581
DS
76The seventh field consists of all the text
77on a line following the sixth field,
78including spaces and tabs;
79this text is treated as a command
80which is executed by the Shell at the
44828dbf 81specified times.
0244f581 82A percent character (``%'')
44828dbf
KM
83in this field is translated to a new-line
84character.
44828dbf 85.PP
526abb6f
JL
86Both
87crontab files are checked by
44828dbf 88.I cron
526abb6f 89every minute, on the minute.
44828dbf
KM
90.SH FILES
91/usr/lib/crontab
526abb6f
JL
92.br
93/usr/lib/crontab.local