xref: /openbsd/usr.sbin/cron/crontab.1 (revision 274d7c50)
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.\" $OpenBSD: crontab.1,v 1.33 2015/10/26 15:50:06 millert Exp $
21.\"
22.Dd $Mdocdate: October 26 2015 $
23.Dt CRONTAB 1
24.Os
25.Sh NAME
26.Nm crontab
27.Nd maintain crontab files for individual users
28.Sh SYNOPSIS
29.Nm
30.Op Fl u Ar user
31.Ar file
32.Nm
33.Oo
34.Fl e | l | r
35.Oc
36.Op Fl u Ar user
37.Sh DESCRIPTION
38.Nm
39is the program used to install, deinstall, or list the tables
40used to drive the
41.Xr cron 8
42daemon.
43Each user can have their own
44.Xr crontab 5 ,
45and though these are files in
46.Pa /var/cron/tabs ,
47they are not intended to be edited directly.
48.Pp
49The first form of this command is used to install a new crontab from some
50named file, or standard input if the pseudo-filename
51.Sq -
52is given.
53.Pp
54If the
55.Pa /var/cron/cron.allow
56file exists, then you must be listed therein in order to use
57.Nm .
58If the
59.Pa /var/cron/cron.allow
60file does not exist but the
61.Pa /var/cron/cron.deny
62file does exist, then you must
63.Em not
64be listed in the
65.Pa /var/cron/cron.deny
66file in order to use
67.Nm .
68If neither of these files exists then only the super user
69will be allowed to use
70.Nm .
71.Em NOTE :
72if they exist,
73.Pa /var/cron/cron.allow
74and
75.Pa /var/cron/cron.deny
76must be readable by group crontab.
77If
78.Nm
79is unable to read the files, users will not be allowed to use
80.Nm .
81.Pp
82The options are as follows:
83.Bl -tag -width "-u userX"
84.It Fl e
85Edit the current crontab using the editor specified by
86the
87.Ev VISUAL
88or
89.Ev EDITOR
90environment variables.
91After you exit from the editor, the modified
92.Xr crontab 5
93will be installed automatically.
94.It Fl l
95Causes the current crontab to be displayed on standard output.
96.It Fl r
97Causes the current crontab to be removed.
98.It Fl u Ar user
99Specifies the name of the user whose
100.Xr crontab 5
101is to be edited.
102If this option is not given,
103.Nm
104examines
105.Dq your
106.Xr crontab 5 ;
107i.e., the
108crontab of the person executing the command.
109Note that
110.Xr su 1
111can confuse
112.Nm
113and that if you are running inside of
114.Xr su 1
115you should always use the
116.Fl u
117option for safety's sake.
118.El
119.Sh ENVIRONMENT
120.Bl -tag -width "EDITOR"
121.It Ev EDITOR , VISUAL
122Specifies an editor to use.
123If both
124.Ev EDITOR
125and
126.Ev VISUAL
127are set,
128.Ev VISUAL
129takes precedence.
130If neither
131.Ev EDITOR
132nor
133.Ev VISUAL
134are set, the default is
135.Xr vi 1 .
136.El
137.Sh FILES
138.Bl -tag -width "/var/cron/cron.allow" -compact
139.It Pa /var/cron/cron.allow
140list of users allowed to use crontab
141.It Pa /var/cron/cron.deny
142list of users prohibited from using crontab
143.It Pa /var/cron/tabs
144directory of individual crontabs
145.El
146.Sh DIAGNOSTICS
147A fairly informative usage message appears if you run it with a bad command
148line.
149.Sh SEE ALSO
150.Xr at 1 ,
151.Xr crontab 5 ,
152.Xr cron 8
153.Sh STANDARDS
154The
155.Nm
156utility is compliant with the
157.St -p1003.1-2008
158specification.
159.Pp
160The flag
161.Op Fl u
162is an extension to that specification.
163.Pp
164The flag
165.Op Fl e
166is marked by
167.St -p1003.1-2008
168as being optional.
169.Pp
170The cron.allow/deny mechanism is marked by
171.St -p1003.1-2008
172as being an
173X/Open System Interfaces
174option.
175.Sh AUTHORS
176.An Paul Vixie Aq Mt vixie@isc.org
177