SUNWcsu
- if the user’s name appears in /etc/cron.d/cron.allow.
- if /etc/cron.d/cron.allow does not exist and the user’s name is not in /etc/cron.d/cron.deny.
Users: Access to crontab is denied:
- if /etc/cron.d/cron.allow exists and the user’s name is not in it.
- if /etc/cron.d/cron.allow does not exist and user’s name is in /etc/cron.d/cron.deny.
- if neither file exists.
Note that the rules for allow and deny apply to root only if the allow/deny files exist.
The allow/deny files consist of one user name per line.
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). Both are adhered to if specified as a list of elements. See EXAMPLES.
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. Other lines are made available to the command as standard input. Any line beginning with a ‘#’ is a comment and will be ignored. The file should not contain blank lines.
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. cron supplies a default environment for every shell, defining HOME , LOGNAME , SHELL (=/bin/sh), TZ , and PATH . The default PATH for user cron jobs is /usr/bin; while root cron jobs default to /usr/sbin:/usr/bin. The default PATH can be set in /etc/default/cron; see cron(1M) .
If you do not redirect the standard output and standard error of your commands, any generated output or errors will be mailed to you.
15 3 * * 1-5 find $HOME -name core 2>/dev/null | xargs rm -f
0 12 14 2 * mailx john%Happy Birthday!%Time for lunch.
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.
If a super-user modifies another user’s crontab file, resulting behavior may be unpredictable. Instead, the privileged user should first su(1M) to the other user’s login before making any changes to the crontab file.