An event schedule can define recurring events, that are used to trigger actions repeatedly without the need to specify the exact date and time for each of these points in time.
The definition of the recurring events is done using repetition schemes and is similar to the way you schedule jobs with the Cron scheduler common on Unix-like operating systems.
A repetition scheme consists of five fields minutes of hour, hours of day, days of month, months of year, and days of week. Each of these fields can hold a comma separated list of alphanumeric definitions as described in table 1. The definitions for one filed are put together with a logical OR, therefore the sequence of definitions in a field not relevant.
A recurring event is due at a specific point in time if at least one of the expressions in each of these five fields match that specific point in time.
The definition for recurring events in an event schedule can optionally have a start date and an end date that define the validity time span of the recurring event definition. Table 3 shows the effects of setting these boundary values.
Expressions in repetition scheme fields |
Single wildcard expression. A single wildcard (*), which covers all values for the field. So a * in days of month means all days of a month (which varies with month and year). If present, a single wildcard expression must be the only expression for a field. |
Single Numeric expression. A single numeric value, e.g. 5. Naturally, the set of values that are valid for each field varies. See table 2 for details |
Numeric range expression. A numeric range where the minimum and maximum are separated by a dash, e.g. 1-10. You can also specify these in the wrong order and they will be fixed. So 10-5 will be treated as 5-10. Numeric ranges will be expanded to all integer values in that range. E.g. 5-10 expands to 5,6,7,8,9,10 |
Wildcard with modulo expression. E.g. */4. This means every possible value in that field that has a remainder o zero when divided by 4. Example */6 in the hours of day field will match 00:00, 06:00, 12:00, 18:00 |
Numeric range with modulo expression. E.g. 1-10/2 will result in 2,4,6,8,10 |
Table 1: expressions that can be used in a repetition scheme field
Field |
Range |
Notes |
Minutes |
0-59 |
|
Hours |
0-23 |
|
Days |
1-31 |
|
Months |
1-12 |
|
Days Of Week |
0-6 |
Sunday = 0, Monday = 1 etc. |
Table 2: Valid values for each field of a repetition scheme
Start date |
End date |
Description |
not given |
not given |
Start date and end date do not constrain job triggering. |
given |
not given |
Job will be triggered if triggering time stamp equal or greater than the given start date. |
not given |
given |
Job will be triggered if triggering time stamp is equal or before given end date. |
given |
given |
Job will be triggered if triggering time stamp is between given start date and given end date, which includes time stamps that are equal start date or end date. |
Table 3: Effect of specification of start and end date
Examples
Table 3 lists some examples of repetition schemes and how they would interpreted as a recurring schedule.
Min |
Hours |
Days |
Months |
Days of Week |
Description |
* |
* |
* |
* |
* |
This pattern causes a task to be launched every minute. |
5 |
* |
* |
* |
* |
This pattern causes a task to be launched once every hour, at the fifth minute of the hour (00:05, 01:05, 02:05 etc.). |
0 |
0 |
1 |
* |
* |
This pattern causes a task to be on the first of each month at 00:00 |
12 |
30 |
1-7 |
* |
1 |
This pattern causes a task to be on the first Monday of each month at 12:30 |
* |
12 |
* |
* |
1 |
This pattern causes a task to be launched every minute during the 12th hour of Monday. |
* |
12 |
16 |
* |
1 |
This pattern causes a task to be launched every minute during the 12th hour of Monday, 16th, but only if the day is the 16th of the month. |
59 |
11 |
* |
* |
1,2,3,4,5 |
This pattern causes a task to be launched at 11:59AM on Monday, Tuesday, Wednesday, Thursday and Friday. |
59 |
11 |
* |
* |
1-5 |
This pattern is equivalent to the previous one. |
*/15 |
9-17 |
* |
* |
* |
This pattern causes a task to be launched every 15 minutes between the 9th and 17th hour of the day (9:00, 9:15, 9:30, 9:45 and so on... note that the last execution will be at 17:45). The slash character can be used to identify periodic values, in the form of a/b. |
* |
12 |
10-16/2 |
* |
* |
This pattern causes a task to be launched every minute during the 12th hour of the day, but only if the day is the 10th, the 12th, the 14th or the16th of the month. |
* |
12 |
1-15,17,20-25 |
* |
* |
This pattern causes a task to be launched every minute during the 12th hour of the day, but the day of the month must be between the 1st and the 15th, the 20th and the 25, or at least it must be the 17th. |
Table 4: Examples of repetition schemes