xref: /freebsd/usr.sbin/cron/crontab/crontab.1 (revision a57ca37dd1848cd42844d9082c4a74c2ed57f68a)
1.\"/* Copyright 1988,1990,1993 by Paul Vixie
2.\" * All rights reserved
3.\" */
4.\"
5.\"Copyright (c) 1997 by Internet Software Consortium
6.\"
7.\"Permission to use, copy, modify, and distribute this software for any
8.\"purpose with or without fee is hereby granted, provided that the above
9.\"copyright notice and this permission notice appear in all copies.
10.\"
11.\"THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
12.\"ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
13.\"OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
14.\"CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15.\"DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16.\"PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
17.\"ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
18.\"SOFTWARE.
19.\"
20.\" $Id: crontab.1,v 1.2 1998/08/14 00:32:37 vixie Exp $
21.\"
22.Dd December 20, 2016
23.Dt CRONTAB 1
24.Os
25.Sh NAME
26.Nm crontab
27.Nd maintain crontab files for individual users (V3)
28.Sh SYNOPSIS
29.Nm
30.Op Fl u Ar user
31.Ar file
32.Nm
33.Op Fl u Ar user
34{
35.Fl l |
36.Fl r Op Fl f
37|
38.Fl e
39}
40.Sh DESCRIPTION
41The
42.Nm
43utility is the program used to install, deinstall or list the tables
44used to drive the
45.Xr cron 8
46daemon in Vixie Cron.
47Each user can have their own crontab, and though
48these are files in
49.Pa /var ,
50they are not intended to be edited directly.
51.Pp
52If the
53.Pa allow
54file exists, then you must be listed therein in order to be allowed to use
55this command.
56If the
57.Pa allow
58file does not exist but the
59.Pa deny
60file does exist, then you must
61.Em not
62be listed in the
63.Pa deny
64file in order to use this command.
65If neither of these files exists, then
66depending on site-dependent configuration parameters, only the super user
67will be allowed to use this command, or all users will be able to use this
68command.
69The format of these files is one username per line,
70with no leading or trailing whitespace.
71Lines of other formats will be ignored,
72and so can be used for comments.
73.Pp
74The first form of this command is used to install a new crontab from some
75named file or standard input if the pseudo-filename
76.Sq Fl
77is given.
78.Pp
79The following options are available:
80.Bl -tag -width indent
81.It Fl u
82Specify the name of the user whose crontab is to be
83tweaked.
84If this option is not given,
85.Nm
86examines
87.Dq your
88crontab, i.e., the crontab of the person executing the
89command.
90Note that
91.Xr su 1
92can confuse
93.Nm
94and that if you are running inside of
95.Xr su 1
96you should always use the
97.Fl u
98option for safety's sake.
99.It Fl l
100Display the current crontab on standard output.
101.It Fl r
102Remove the current crontab.
103By default the
104.Fl r
105option prompts for confirmation, adding the
106.Fl f
107option will attempt to remove the current crontab without confirmation.
108.It Fl e
109Edit the current crontab using the editor specified by
110the
111.Ev VISUAL
112or
113.Ev EDITOR
114environment variables.
115The specified editor
116.Em must
117edit the file in place;
118any editor that unlinks the file and recreates it cannot be used.
119After you exit
120from the editor, the modified crontab will be installed automatically.
121.El
122.Sh FILES
123.Bl -tag -width /var/cron/allow -compact
124.It Pa /var/cron/allow
125List of users allowed to use crontab
126.It Pa /var/cron/deny
127List of users prohibited from using crontab
128.It Pa /var/cron/tabs
129Directory for personal crontab files
130.El
131.Sh DIAGNOSTICS
132A fairly informative usage message appears if you run it with a bad command
133line.
134.Sh SEE ALSO
135.Xr crontab 5 ,
136.Xr cron 8
137.Sh STANDARDS
138The
139.Nm
140command conforms to
141.St -p1003.2
142with the exception that the dangerous variant of calling
143.Nm
144without a file name in the first form of the command is not allowed by
145this implementation.
146The pseudo-filename
147.Sq Fl
148must be specified to read from standard input.
149The new command syntax
150differs from previous versions of Vixie Cron, as well as from the classic
151SVR3 syntax.
152.Sh AUTHORS
153.An Paul Vixie Aq Mt paul@vix.com
154