UNIX cron format
The UNIX cron format is a way of specifying time for the point-in-time parameter of the ADMIN_TASK_ADD stored procedure.
The cron format has five time and date fields separated by at least one blank. There can be no blank within a field value. Scheduled tasks are executed when the minute, hour, and month of year fields match the current time and date, and at least one of the two day fields (day of month, or day of week) match the current date.
The allowed values for the time and date fields are:
- Field
- Allowed values
- minute
- 0-59
- hour
- 0-23
- day of month
- 1-31
- month
- 1-12, where 1 is January
- Upper-, lower-, or mixed-case three-character strings, based on the English name of the month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, or dec.
- day of week
- 0-7, where 0 or 7 is Sunday
- Upper-, lower-, or mixed-case three-character strings, based on the English name of the day: mon, tue, wed, thu, fri, sat, or sun.
Ranges and lists
Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive. For example, the range 8-11 for an hour entry specifies execution at hours 8, 9, 10 and 11.
Lists are allowed. A list is a set of numbers or ranges separated by commas. for example:
1,2,5,9
0-4,8-12
Unrestricted range
A field can contain an asterisk (*), which represents all possible values in the field.
The day of a command's execution can be specified by two fields: day of month and day of week. If both fields are restricted by the use of a value other than the asterisk, the command will run when either field matches the current time.
For example, The value 30 4 1,15 * 5 causes a command to run at 4:30 AM on the 1st and 15th of each month, plus every Friday.
Step values
Step values can be used in conjunction with ranges. The syntax range/step defines the range and an execution interval.
If you specify first-last/step, execution takes place at first, then at all successive values that are distant from first by step, until last.
- Example
- To specify command execution every other hour, use 0-23/2. This expression is equivalent to the value 0,2,4,6,8,10,12,14,16,18,20,22.
If you specify */step, execution takes place at every interval of step through the unrestricted range.
- Example
- As an alternative to 0-23/2 for execution every other hour, use */2.