crontab.1 (2010 09)
c
crontab(1) crontab(1)
00**1command
runs command only on Mondays.
The sixth field, command (the balance of a line including blanks in a crontab file), is a string that is exe-
cuted by the shell at the specified times. A percent character (
%) in this field (unless escaped by a
backslash (
\)) is translated to a newline character, dividing the field into "lines". Only the first "line" (up
to a % or end-of-line) of the command field is executed by the shell. Any other "lines" are made available
to the command as standard input.
Blank lines and those whose first non-blank character is
# will be ignored.
cron invokes the command from the user’s
HOME directory with the POSIX shell, (/usr/bin/sh). It
runs in the
c queue (see queuedefs (4)).
cron supplies a default environment for every shell, defining:
HOME=user’s-home-directory
LOGNAME=user’s-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh
Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a
script called by the entry.
You can execute
crontab if your name appears in the file /usr/lib/cron/cron.allow
. If that file
does not exist, you can use
crontab if your name does not appear in the file
/usr/lib/cron/cron.deny
. If only cron.deny exists and is empty, all users can use crontab.
If neither file exists, only the
root user can use crontab. The allow/
deny files consist of one user
name per line.
Security Restrictions
If the compartmentalization feature is enabled,
cron and crontab invoke the jobs from the compart-
ment that the jobs were created from. Note that
crontab creates the job files in
/var/spool/cron/crontabs
. Hence, if the crontab command is invoked from a compartment
which has no write access to this directory and which disallows the
COMMALLOWED privilege, crontab
fails to schedule the jobs. See compartments (5) and privileges (5) for more information.
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines the interpretation of text within file as single and/or multibyte characters.
LC_MESSAGES determines the language in which messages are displayed.
If
LC_CTYPE or LC_MESSAGES is not specified in the environment or is set to the empty string, the
value of LANG is used as a default for each unspecified or empty variable. If
LANG is not specified or is
set to the empty string, a default of "C" (see lang (5)) is used instead of
LANG.
If any internationalization variable contains an invalid setting,
crontab behaves as if all international-
ization variables are set to "C". See environ (5). EDITOR determines the editor to be invoked when -e
option is specified. The default editor is vi.
International Code Set Support
Single-byte and multibyte character code sets are supported.
WARNINGS
Be sure to redirect the standard output and standard error from commands. If this is not done, any gen-
erated standard output or standard error is mailed to the user.
The behavior of cron (1M) is undefined if a non existent monthday of a month is specified in the crontab
entry. For example, the dates 29, 30, and 31 do not occur in all months of a year, so jobs should not be
scheduled for these days for the months in which they do not occur.
FILES
/var/adm/cron Main cron directory
/var/adm/cron/cron.allow List of allowed users
/var/adm/cron/cron.deny List of denied users
/var/adm/cron/log Accounting information
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010