Go to main content

Managing System Information, Processes, and Performance in Oracle® Solaris 11.4

Exit Print View

Updated: October 2019
 
 

Syntax of crontab File Entries

A crontab file consists of commands, one command per line, that execute automatically at the time specified by the first five fields of each command line, which are separated by spaces.

The following are the acceptable numerical values for crontab time entry:

Minute

0-59

Hour

0-23

Day of month

1-31

Month

1-12

Day of week

0-6 (0 = Sunday)

    The following special characters are used in crontab time fields:

  • Space separates each field

  • Comma separates multiple values

  • Hyphen designates a range of values

  • Asterisk (*) is a wildcard to include all possible values

  • Comment mark (#) at the beginning of a line indicates a comment or a blank line

For example, the following crontab command entry displays a reminder in the user's console window at 4 pm on the first and fifteenth days of every month.

0 16 1,15 * * echo Timesheets Due > /dev/console

Each command within a crontab file must consist of one line, even if that line is very long. The crontab file does not recognize extra carriage returns. For more detailed information about crontab entries and command options, refer to the crontab(1) man page.