Debian Codegraph @

upstream/mageia-cauldron/man1/crontab.1

raw
1 .\"/* Copyright 1988,1990,1993 by Paul Vixie
2 .\" * All rights reserved
3 .\" */
4 .\"
5 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
6 .\" Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
7 .\"
8 .\" Permission to use, copy, modify, and distribute this software for any
9 .\" purpose with or without fee is hereby granted, provided that the above
10 .\" copyright notice and this permission notice appear in all copies.
11 .\"
12 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
13 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
15 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
18 .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .\"
20 .\" Modified 2010/09/12 by Colin Dean, Durham University IT Service,
21 .\" to add clustering support.
22 .\"
23 .\" $Id: crontab.1,v 1.7 2004/01/23 19:03:32 vixie Exp $
24 .\"
25 .TH CRONTAB 1 "2019-10-29" "cronie" "User Commands"
26 .SH NAME
27 crontab \- maintains crontab files for individual users
28 .SH SYNOPSIS
29 .B crontab
30 .RB [ -u
31 .IR user ]
32 .RI < "file"
33 .RB | \ - >
34 .br
35 .B crontab
36 .RB [ -T ]
37 .RI < "file"
38 .RB | \ - >
39 .br
40 .B crontab
41 .RB [ -u
42 .IR user ]
43 .RB < -l " | " -r " | " -e >\ [ -i ]
44 .RB [ -s ]
45 .br
46 .B crontab
47 .BR -n \ [
48 .IR "hostname " ]
49 .br
50 .B crontab
51 .BR -c
52 .br
53 .B crontab
54 .BR -V
55 .SH DESCRIPTION
56 .I Crontab
57 is the program used to install a crontab table
58 .IR file ,
59 remove or list the existing tables used to serve the
60 .BR cron (8)
61 daemon. Each user can have their own crontab, and though these are files
62 in
63 .IR /var/spool/ ,
64 they are not intended to be edited directly. For SELinux in MLS mode,
65 you can define more crontabs for each range. For more information, see
66 .BR selinux (8).
67 .PP
68 In this version of
69 .IR Cron
70 it is possible to use a network-mounted shared
71 .I /var/spool/cron
72 across a cluster of hosts and specify that only one of the hosts should
73 run the crontab jobs in the particular directory at any one time. You
74 may also use
75 .BR crontab
76 from any of these hosts to edit the same shared set of crontab files, and
77 to set and query which host should run the crontab jobs.
78 .PP
79 Scheduling cron jobs with
80 .BR crontab
81 can be allowed or disallowed for different users. For this purpose, use the
82 .I cron.allow
83 and
84 .I cron.deny
85 files. If the
86 .I cron.allow
87 file exists, a user must be listed in it to be allowed to use
88 .BR crontab .
89 If the
90 .I cron.allow
91 file does not exist but the
92 .I cron.deny
93 file does exist, then a user must
94 .I not
95 be listed in the
96 .I cron.deny
97 file in order to use
98 .BR crontab.
99 If neither of these files exist, then only the super user is allowed to use
100 .BR crontab .
101 .PP
102 Another way to restrict the scheduling of cron jobs beyond
103 .BR crontab
104 is to use PAM authentication in
105 .I /etc/security/access.conf
106 to set up users, which are allowed or disallowed to use
107 .BR crontab
108 or modify system cron jobs in the
109 .IR /etc/cron.d/
110 directory.
111 .PP
112 The temporary directory can be set in an environment variable. If it is
113 not set by the user, the
114 .I /tmp
115 directory is used.
116 .PP
117 When listing a crontab on a terminal the output will be colorized unless
118 an environment variable
119 .I NO_COLOR
120 is set.
121 .PP
122 On edition or deletion of the crontab, a backup of the last crontab will be saved to
123 .I $XDG_CACHE_HOME/crontab/crontab.bak
124 or
125 .I $XDG_CACHE_HOME/crontab/crontab.<user>.bak
126 if
127 .B -u
128 is used.
129 If the
130 .I XDG_CACHE_HOME
131 environment variable is not set,
132 .I $HOME/.cache
133 will be used instead.
134 .PP
135 .SH "OPTIONS"
136 .TP
137 .B "\-u"
138 Specifies the name of the user whose crontab is to be modified. If this
139 option is not used,
140 .BR crontab
141 examines "your" crontab, i.e., the crontab of the person executing the
142 command. If no crontab exists for a particular user, it is created for
143 them the first time the
144 .B crontab -u
145 command is used under their username.
146 .TP
147 .B "\-T"
148 Test the crontab file syntax without installing it.
149 Once an issue is found, the validation is interrupted, so this will not return all the existing issues at the same execution.
150 .TP
151 .B "\-l"
152 Displays the current crontab on standard output.
153 .TP
154 .B "\-r"
155 Removes the current crontab.
156 .TP
157 .B "\-e"
158 Edits the current crontab using the editor specified by the
159 .I VISUAL
160 or
161 .I EDITOR
162 environment variables. After you exit from the editor, the modified
163 crontab will be installed automatically.
164 .TP
165 .B "\-i"
166 This option modifies the
167 .B "\-r"
168 option to prompt the user for a 'y/Y' response before actually removing
169 the crontab.
170 .TP
171 .B "\-s"
172 Appends the current SELinux security context string as an MLS_LEVEL
173 setting to the crontab file before editing / replacement occurs - see the
174 documentation of MLS_LEVEL in
175 .BR crontab (5).
176 .TP
177 .B "\-n"
178 This option is relevant only if
179 .BR cron (8)
180 was started with the
181 .B \-c
182 option, to enable clustering support. It is used to set the host in the
183 cluster which should run the jobs specified in the crontab files in the
184 .I /var/spool/cron
185 directory. If a hostname is supplied, the host whose hostname returned
186 by
187 .BR gethostname (2)
188 matches the supplied hostname, will be selected to run the selected cron jobs subsequently. If there
189 is no host in the cluster matching the supplied hostname, or you explicitly specify
190 an empty hostname, then the selected jobs will not be run at all. If the hostname
191 is omitted, the name of the local host returned by
192 .BR gethostname (2)
193 is used. Using this option has no effect on the
194 .I /etc/crontab
195 file and the files in the
196 .I /etc/cron.d
197 directory, which are always run, and considered host-specific. For more
198 information on clustering support, see
199 .BR cron (8).
200 .TP
201 .B "\-c"
202 This option is only relevant if
203 .BR cron (8)
204 was started with the
205 .B \-c
206 option, to enable clustering support. It is used to query which host in
207 the cluster is currently set to run the jobs specified in the crontab
208 files in the directory
209 .I /var/spool/cron
210 , as set using the
211 .B \-n
212 option.
213 .TP
214 .B "\-V"
215 Print version and exit.
216 .SH CAVEATS
217 The files
218 .I cron.allow
219 and
220 .I cron.deny
221 cannot be used to restrict the execution of cron jobs; they only restrict the
222 use of
223 .BR crontab .
224 In particular, restricting access to
225 .BR crontab
226 has no effect on an existing
227 .I crontab
228 of a user. Its jobs will continue to be executed until the crontab is removed.
229 .PP
230 The files
231 .I cron.allow
232 and
233 .I cron.deny
234 must be readable by the user invoking
235 .BR crontab .
236 If this is not the case, then they are treated as non-existent.
237 .SH "SEE ALSO"
238 .BR crontab (5),
239 .BR cron (8)
240 .SH FILES
241 .nf
242 /etc/cron.allow
243 /etc/cron.deny
244 .fi
245 .SH STANDARDS
246 The
247 .I crontab
248 command conforms to IEEE Std1003.2-1992 (``POSIX'') with one exception:
249 For replacing the current crontab with data from standard input the
250 .B \-
251 has to be specified on the command line if the standard input is a TTY.
252 This new command syntax differs from previous versions of Vixie Cron,
253 as well as from the classic SVR3 syntax.
254 .SH DIAGNOSTICS
255 An informative usage message appears if you run a crontab with a faulty
256 command defined in it.
257 .SH AUTHOR
258 .MT [email protected]
259 Paul Vixie
260 .ME
261 .br
262 .MT [email protected]
263 Colin Dean
264 .ME