Spring cron syntax
Cron is a software utility that specifies commands to run on a given schedule. This schedule is defined by a cron pattern, which has a specific syntax.
Warning If you create an invalid cron pattern, Collibra Data Intelligence Platform stops responding.
Note By default, Collibra Console uses Spring cron expressions to schedule back-ups, while you use Quartz cron expressions, for example, to schedule your mail, LDAP synchronizations, Purge cycles, Tableau and S3 synchronizations or to create a statistics cron map.
The cron pattern consists of 6 space-separated fields, with the seconds field either set to 0 or completely ignored by Collibra Console:
<second> <minute> <hour> <day of month> <month> <day of week>
Position |
Field |
Allowed values | Allowed special characters |
Examples |
---|---|---|---|---|
1 |
second |
0 Note Collibra transforms this pattern into a Unix cron pattern. Because Unix cron expressions don't include seconds, set this value to 0. |
N/A |
N/A |
2 |
minute | 0-59 | , - * / |
|
3 |
hour | 0-23 | , - * / |
|
4 |
day of the month | 1-31 | , - * ? / L W |
|
5 |
month | 1-12 or JAN-DEC | , - * / |
Tip The names of the months are not case-sensitive. |
6 |
day of the week |
0-7 or MON-SUN where 0 and 7 is Sunday. |
, - * ? / L # |
Tip The names of the days are not case-sensitive. |
For more information, see the Spring cron documentation.
Special characters
Character | Description |
---|---|
* |
Used to select all values within a field. Example |
? |
Used to specify something in one of the two fields in which the character is allowed, but not the other, mainly used for days of the week. Example If you want your trigger to fire on a particular day of the month, for example the 10th, but don't care what day of the week that happens to be, you could put "10" in the day-of-month field, and "?" in the day of the week field. |
- |
Used to specify ranges. Example |
, |
Used to specify additional values. Example |
/ |
Used to specify increments. Example |
L |
The value
|
W |
Used to specify the weekday (Monday-Friday) nearest the given day. Example
However if you specify Tip The 'L' and 'W' characters can also be combined in the day-of-month field to yield 'LW', which translates to *"last weekday of the month"*. |
# |
Used to specify “the nth” XXX day of the month. Example |
0 0 * * * *
= the top of every hour of every day.0 0 8-10 * * *
= 8, 9 and 10 o'clock of every day.0 0 6,19 * * *
= 6:00 AM and 7:00 PM every day.0 0/30 8-10 * * *
= 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.0 0 9-17 * * MON-FRI
= on the hour nine-to-five weekdays.0 0 0 25 12 ?
= every Christmas Day at midnight, no matter what weekday it is.