crontab(1) CLIX crontab(1)
NAME
crontab - Establishes a user crontab file
SYNOPSIS
crontab [file]
crontab -r
crontab -l
FLAGS
-r Removes a user's crontab from the crontab directory.
-l Lists the crontab file for the invoking user.
DESCRIPTION
The crontab command establishes a user crontab file. The command copies
the specified file, or stdin if no file is specified, into a directory
that holds all users' crontabs.
Users are permitted to use crontab if their names appear in the file
/usr/lib/cron/cron.allow. If that file does not exist, the file
/usr/lib/cron/cron.deny is checked to determine if the user should be
denied access to crontab. If neither file exists, only root is allowed to
submit a job. If cron.allow does not exist and cron.deny exists but is
empty, global usage is permitted. The allow/deny files consist of one
username per line.
A crontab file consists of lines of six fields each. The fields are
separated by spaces or tabs. The first five are integer patterns that
specify the following:
⊕ minute (0-59),
⊕ hour (0-23),
⊕ day of the month (1-31),
⊕ month of the year (1-12),
⊕ day of the week (0-6 with 0=Sunday).
Each of these patterns may be either an asterisk (meaning all legal
values) or a list of elements separated by commas. An element is either a
number or two numbers separated by a minus sign (meaning an inclusive
range). Note that the specification of days may be made by two fields
(day of the month and day of the week). If both are specified as a list
2/94 - Intergraph Corporation 1
crontab(1) CLIX crontab(1)
of elements, both are adhered to. For example, 0 0 1,15 * 1 would run a
command on the first and fifteenth of each month, as well as on every
Monday. To specify days by only one field, the other field should be set
to * (for example, 0 0 * * 1 would run a command only on Mondays).
The sixth field of a line in a crontab file is a string that is executed
by the shell at the specified times. A percent character in this field
(unless escaped by \) is translated to a newline character. Only the
first line (up to a % or end of line) of the command field is executed by
the shell. The other lines are made available to the command as stdin.
The shell is invoked from your $HOME directory with an arg0 of sh. Users
who desire to have their .profile executed must explicitly do so in the
crontab file. The cron process supplies a default environment for every
shell, defining HOME, LOGNAME, SHELL(=/bin/sh), and
PATH(=:/bin:/usr/bin:/usr/lbin).
If you do not redirect stdout and stderr of your commands, any generated
output or errors will be mailed to you.
EXAMPLES
1. To list the entries in your crontab files:
crontab -l
2. To remove your crontab file:
crontab -r
3. To read the myfile file and create a crontab file in
/usr/spool/cron/crontabs with your login name:
crontab myfile
FILES
/usr/lib/cron Main cron directory
/usr/spool/cron/crontabs Spool area
/usr/lib/cron/log Accounting information
/usr/lib/cron/cron.allow List of allowed users
/usr/lib/cron/cron.deny List of denied users
CAUTIONS
2 Intergraph Corporation - 2/94
crontab(1) CLIX crontab(1)
If you inadvertently enter the crontab command with no argument(s), do not
attempt to exit by keying in <Ctrl-D>. This will cause all entries in
your crontab file to be removed. Instead, exit by pressing <Delete>.
EXIT VALUES
The crontab command returns a value of 0 if successful. If unsuccessful,
crontab returns a value of 1.
RELATED INFORMATION
Commands: sh(1), cron(8)
2/94 - Intergraph Corporation 3