source: trunk/minix/man/man5/crontab.5@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 4.6 KB
Line 
1.TH CRONTAB 5
2.SH NAME
3crontab \- table of jobs to be performed by cron
4.SH SYNOPSIS
5.nf
6.ft B
7/usr/lib/crontab
8/usr/local/lib/crontab
9/var/lib/crontab
10/var/opt/\fIname\fP/lib/crontab\ \ \fR(Minix-vmd only)\fB
11/usr/spool/crontabs/\fIuser\fP
12.ft R
13.fi
14.SH DESCRIPTION
15The
16.BR cron (8)
17daemon runs jobs at regular intervals. These jobs are listed in
18.B crontab
19files. The format of entries in a crontab file are five fields of numbers
20specifying the minute (0\-59), hour (0\-23), day of the month (1\-31), month
21(1\-12), and day of the week (0\-6 with 0 = Sunday) that a task must be
22executed. The task to be executed follows as a shell command.
23.PP
24The time numbers can be given as a comma separated list of simple numbers,
25ranges ("2\-5" is the same as "2,3,4,5"), and repeats ("2:5" means
26"2,7,12,17,22" in the hour field). A repeat is cyclic affair, i.e. 2:5
27and 12:5 are the same thing. A single "*" can be used in a field to
28indicate all valid numbers in that field, so it translates to "always". In
29the minute field you can use "?" for the current minute that the crontab
30file is loaded. It can be used in a repeat, i.e. "?:10" for every 10
31minutes. This keeps machines with identical crontabs from executing tasks
32at exactly the same time, causing a burst of traffic if anything is done
33over a network.
34.PP
35If a given time is valid in all five fields then a command is executed.
36Here are a few examples that illustrate the possibilities:
37.PP
38.if t .RS
39.if t .ft C
40.nf
41# min hour mday mon wday command
42 ? 3 * * * /usr/etc/daily # Daily system cleanup
43 0 * * * * date # Print date on the hour
44 30 4 * * 2\-6 /var/etc/backup # After workdays on 4:30
45 0 9 25 12 * \-u ast sing # Andy sings on Xmas morning
46 0 0 13 * 5 echo Beware! # For the superstitious
47.fi
48.if t .ft P
49.if t .RE
50.PP
51The command may optionally be prefixed by
52.BI \-u " user"
53to specify under which user the command should be run. Commands from
54crontabs in the spool directory are always run under the id of the crontab's
55owner, the
56.B \-u
57flag is ignored.
58.PP
59A command can be placed on the same line as the time fields, or on the next
60line indented by one TAB character. (A TAB, not eight spaces.) More TAB
61indented lines can be added for a multiline command. The tabs are removed
62from the command when passed to the shell. If a command is put on the same
63line as the time fields then percent characters are changed into newlines,
64this is not done for a TAB indented command. The following three entries
65give the same output:
66.PP
67.RS
68.if t .ft C
69.nf
70.ta +8n
710 12 * * * echo 'Hello'; echo ' World!'
72#1
730 12 * * * echo 'Hello% World!' #2
740 12 * * * #3
75 cat <<EOF #4
76 Hello
77 \& World!
78 EOF
79.fi
80.if t .ft P
81.RE
82.PP
83Comments start with a "#" character and continue until end of line. They,
84excess whitespace, and empty lines are ignored. Of the comments in the
85example above #1 and #3 are ignored by
86.BR cron ,
87but #2 and #4 are not recognized as comments, but are seen as part of a
88command and are passed to the shell who then happens to ignore them. There
89is no interpretation of command characters other than the percent in a
90oneliner. The time fields must all be on the same line.
91.SH FILES
92.TP 25n
93.B /usr/lib/crontab
94Main MINIX 3 crontab file.
95.TP
96.B /usr/local/lib/crontab
97Local jobs for all systems in an organization.
98.TP
99.B /var/lib/crontab
100System specific jobs.
101.TP
102.B /var/opt/\fIname\fP/lib/crontab
103Per package jobs for Minix-vmd.
104.TP
105.B /usr/lib/packages
106List of installed packages.
107.TP
108.B /usr/spool/crontabs/\fIuser\fP
109Per user jobs.
110.SH "SEE ALSO"
111.BR crontab (1),
112.BR cron (8).
113.SH NOTES
114The "?" in the minute field, the repeat field (e.g. "2:5"), TAB indented
115multiline commands and the
116.B \-u
117option are unique to this cron implementation. This doesn't mean you
118shouldn't use these features, but just that you should be aware of the
119differences with other systems. You are even advised to use these features
120and avoid the percent hack for multiline commands.
121.PP
122Other crons allow one to specify input to a job in some way, something this
123cron can't. Simply use the << shell feature to do that. Other crons often
124choke on empty lines.
125.PP
126It is a common bug to use 0 for Sunday instead of 7. This cron, like most
127other crons out there accepts this without comment.
128.PP
129A job is not reissued until a previous instance of it has exited. The next
130time to execute is computed from the previous time it ran. If job issuing
131lags behind on the system time then the next time to run it is computed from
132the current system time.
133.SH AUTHOR
134Kees J. Bot (kjb@cs.vu.nl)
135
136.\"
137.\" $PchId: crontab.5,v 1.3 2000/07/17 18:53:05 philip Exp $
Note: See TracBrowser for help on using the repository browser.