Debian Codegraph @

upstream/debian-unstable/man1/crontab.1

raw
1 '\" t
2 .\" Title: Crontab
3 .\" Author: Paul Vixie <[email protected]>
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\" Date: 2026-04-27
6 .\" Manual: crontab User Manual
7 .\" Source: crontab
8 .\" Language: English
9 .\"
10 .TH "CRONTAB" "1" "2026\-04\-27" "crontab" "crontab User Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 crontab \- maintain crontab files for individual users (Vixie Cron)
32 .SH "SYNOPSIS"
33 .HP \w'\fBcrontab\fR\ 'u
34 \fBcrontab\fR [\fB\-h\fR]
35 .HP \w'\fBcrontab\fR\ 'u
36 \fBcrontab\fR [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-n\fR] \fB\fIfile\fR\fR
37 .HP \w'\fBcrontab\fR\ 'u
38 \fBcrontab\fR [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-i\fR] {\fB\-e\fR\ |\ \fB\-l\fR\ |\ \fB\-r\fR}
39 .SH "DESCRIPTION"
40 .PP
41 \fBcrontab\fR
42 is the program used to install, deinstall or list the tables used to drive the
43 \fBcron\fR(8)
44 daemon in Vixie Cron\&. Each user can have their own crontab, and though these are files in
45 \fI/var/spool/cron/crontabs\fR, they are not intended to be edited directly\&.
46 .PP
47 If the
48 \fI/etc/cron\&.allow\fR
49 file exists, then you must be listed (one user per line) therein in order to be allowed to use this command\&. If the
50 \fI/etc/cron\&.allow\fR
51 file does not exist but the
52 \fI/etc/cron\&.deny\fR
53 file does exist, then you must not be listed in the
54 \fI/etc/cron\&.deny\fR
55 file in order to use this command\&.
56 .PP
57 Please check that the permissions of the file
58 \fI/etc/cron\&.allow\fR
59 make it readable by the users which are allowed\&. For example, permissions rw\-\ \&r\-\-\ \&r\-\- (octal 644) should be OK\&.
60 .PP
61 If neither of these files exists, then depending on site\-dependent configuration parameters, only the super user will be allowed to use this command, or all users will be able to use this command\&.
62 .PP
63 If both files exist then
64 \fI/etc/cron\&.allow\fR
65 takes precedence\&. Which means that
66 \fI/etc/cron\&.deny\fR
67 is not considered and your user must be listed in
68 \fI/etc/cron\&.allow\fR
69 in order to be able to use the crontab\&.
70 .PP
71 Regardless of the existence of any of these files, the root administrative user is always allowed to setup a crontab\&. For standard Debian systems, all users may use this command\&.
72 .PP
73 If the
74 \fB\-h\fR
75 option is given,
76 \fBcrontab\fR
77 shows a help message and quits immediately\&.
78 .PP
79 If the
80 \fB\-u\fR
81 option is given, it specifies the name of the user whose crontab is to be used (when listing) or modified (when editing)\&. If this option is not given,
82 \fBcrontab\fR
83 examines "your" crontab file, i\&.e\&., the crontab file of the person executing the command\&. Note that
84 \fBsu\fR(8)
85 can confuse
86 \fBcrontab\fR
87 and that if you are running inside of
88 \fBsu\fR(8)
89 you should always use the
90 \fB\-u\fR
91 option for safety\*(Aqs sake\&.
92 .PP
93 The first form of this command is used to install a new crontab from some named file or standard input if the pseudo\-filename ``\-\*(Aq\*(Aq is given\&.
94 .PP
95 If the
96 \fI\-n\fR
97 option is given, it means "dry run":
98 \fBcrontab\fR
99 examines "your" crontab for its syntax, and outputs a success message if this syntax is correct, but nothing is written to any crontab\&.
100 .PP
101 The
102 \fI\-l\fR
103 option causes the current crontab to be displayed on standard output\&. See the note under
104 the section called \(lqDEBIAN SPECIFIC\(rq
105 below\&.
106 .PP
107 The
108 \fB\-r\fR
109 option causes the current crontab to be removed\&.
110 .PP
111 The
112 \fB\-e\fR
113 option is used to edit the current crontab using
114 \fBsensible-editor\fR(1)\&. After you exit from the editor, the modified crontab will be installed automatically\&.
115 .PP
116 The
117 \fI\-i\fR
118 option modifies the
119 \fI\-r\fR
120 option to prompt the user for a \*(Aqy/Y\*(Aq response before actually removing the crontab\&.
121 .SH "DEBIAN SPECIFIC"
122 .PP
123 The "out\-of\-the\-box" behaviour for
124 \fBcrontab \-l\fR
125 is to display the three line "DO NOT EDIT THIS FILE" header that is placed at the beginning of the crontab when it is installed\&. The problem is that it makes the sequence
126 .PP
127 \fBcrontab \-l | crontab \-\fR
128 .PP
129 non\-idempotent \(em you keep adding copies of the header\&. This causes pain to scripts that use sed to edit a crontab\&. Therefore, the default behaviour of the
130 \fI\-l\fR
131 option has been changed to not output such header\&. You may obtain the original behaviour by setting the environment variable
132 \fBCRONTAB_NOHEADER\fR
133 to \*(AqN\*(Aq, which will cause the
134 \fBcrontab \-l\fR
135 command to emit the extraneous header\&.
136 .SH "HIGHLIGHTING THE OUTPUT OF CRONTAB \-L"
137 .PP
138 The command
139 \fBcrontab \-l\fR
140 outputs plain text\&. When a tty can support ANSI sequences to colourise this text, one can highlight the output, by calling:
141 \fBcrontab \-l | spc \-t crontab\fR
142 when the ttybackground is dark, or
143 \fBcrontab \-l | spc \-t crontab\-light\fR
144 when this background is light\&.
145 .PP
146 The highlighting scheme can be modified by using customised versions of files
147 \fI/etc/supercat/spcrc\-crontab*\fR
148 .PP
149 One can also colourise this text with the program
150 \fBbatcat\fR(1)
151 provided by the package
152 \fBbat\fR, here is an example:
153 .PP
154 \fBcrontab \-l | batcat \-\-language Crontab\fR
155 .SH "SEE ALSO"
156 .PP
157 \fBcrontab\fR(5),
158 \fBcron\fR(8),
159 \fBspc\fR(1)
160 .SH "FILES"
161 .PP
162 \fI/etc/cron\&.allow\fR, \fI/etc/cron\&.deny\fR
163 .RS 4
164 The files
165 \fI/etc/cron\&.allow\fR
166 and
167 \fI/etc/cron\&.deny\fR
168 if they exist, must be either world\-readable, or readable by group ``crontab\*(Aq\*(Aq\&. If they are not, then
169 \fBcron\fR(8)
170 will deny access to all users until the permissions are fixed\&.
171 .RE
172 .PP
173 \fI/var/spool/cron/crontabs\fR
174 .RS 4
175 There is one file for each user\*(Aqs crontab under the
176 \fI/var/spool/cron/crontabs\fR
177 directory\&. Users are not allowed to edit the files under that directory directly to ensure that only users allowed by the system to run periodic tasks can add them, and only syntactically correct crontabs will be written there\&. This is enforced by having the directory writable only by the ``crontab\*(Aq\*(Aq group and configuring
178 \fBcrontab\fR
179 command with the setgid bid set for that specific group\&.
180 .RE
181 .SH "STANDARDS"
182 .PP
183 The
184 \fBcrontab\fR
185 command conforms to IEEE Std1003\&.2\-1992 (``POSIX\*(Aq\*(Aq)\&. This new command syntax differs from previous versions of Vixie Cron, as well as from the classic SVR3 syntax\&.
186 .SH "LIMITATIONS"
187 .PP
188 The maximum permitted length for the command field is 998 characters\&.
189 .PP
190 The recommended length should be less than 80 characters, like lines in readable source files\&. When one must use a long command, it is worth creating a dedicated script, which in turn can contain valuable comments\&.
191 .SH "DIAGNOSTICS"
192 .PP
193 A fairly informative usage message appears if you run it with a bad command line\&.
194 .PP
195 \fBcron\fR(8)
196 requires that each entry in a crontab end in a newline character\&. If the last entry in a crontab is missing the newline,
197 \fBcron\fR(8)
198 will consider the crontab (at least partially) broken and refuse to install it\&.
199 .PP
200 The files under
201 \fI/var/spool/cron/crontabs\fR
202 are named based on the user\*(Aqs account name\&. Crontab jobs will not be run for users whose accounts have been renamed either due to changes in the local system or because they are managed through a central user database (external to the system, for example an LDAP directory)\&.
203 .SH "AUTHORS"
204 .PP
205 \fBPaul Vixie\fR <\&paul@vix\&.com\&>
206 .RS 4
207 Wrote this manpage (1994)\&.
208 .RE
209 .PP
210 \fBSteve Greenland\fR <\&stevegr@debian\&.org\&>
211 .RS 4
212 Maintained the package (1996\-2005)\&.
213 .RE
214 .PP
215 \fBJavier Fern\('andez\-Sanguino Pe\(~na\fR <\&jfs@debian\&.org\&>
216 .RS 4
217 Maintained the package (2005\-2014)\&.
218 .RE
219 .PP
220 \fBChristian Kastner\fR <\&ckk@debian\&.org\&>
221 .RS 4
222 Maintained the package (2010\-2016)\&.
223 .RE
224 .PP
225 \fBGeorges Khaznadar\fR <\&georgesk@debian\&.org\&>
226 .RS 4
227 Maintained the package (2022\-2024)\&.
228 .RE
229 .SH "COPYRIGHT"
230 .br
231 Copyright \(co 1994 Paul Vixie
232 .br
233 .PP
234 Distribute freely, except: don\*(Aqt remove my name from the source or documentation (don\*(Aqt take credit for my work), mark your changes (don\*(Aqt get me blamed for your possible bugs), don\*(Aqt alter or remove this notice\&. May be sold if buildable source is provided to buyer\&. No warranty of any kind, express or implied, is included with this software; use at your own risk, responsibility for damages (if any) to anyone resulting from the use of this software rests entirely with the user\&.
235 .PP
236 Since year 1994, many modifications were made in this manpage, authored by Debian Developers which maintained
237 cron(TM); above is a short list, more information can be found in the file
238 \fI/usr/share/doc/cron/copyright\fR\&.
239 .sp