Quartz 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.
- You can refresh the schema of a data source or synchronize Tableau or Amazon S3 metadata outside office hours to reduce the impact of these actions on the performance of your environment.
- You can create a schedule for LDAP synchronizations, Purge cycles or to automatically send emails using cron patterns. You can also use it to create a cron map for your statistics.
Note By default, you use Spring cron expressions to schedule Collibra Console back-ups.
Warning If you create an invalid cron pattern, Collibra Data Intelligence Platform stops responding.
The cron pattern consists of 6 or 7 space-separated fields:
<second> <minute> <hour> <day of the month> <month> <day of the week> <year>
Position |
Field |
Mandatory |
Allowed values | Allowed special characters |
Examples |
---|---|---|---|---|---|
1 |
second |
Yes |
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 |
Yes |
0-59 | , - * / |
|
3 |
hour |
Yes |
0-23 | , - * / |
|
4 |
day of the month |
Yes |
1-31 | , - * ? / L W |
|
5 |
month |
Yes |
1-12 or JAN-DEC | , - * / |
Tip The names of the months are not case-sensitive. |
6 |
day of the week |
Yes |
1-7 or SUN-SAT |
, - * ? / L # |
Tip The names of the days are not case-sensitive. |
7 |
year Note Collibra transforms this pattern into a Unix cron pattern. Because Unix cron expressions don't include years, this value will be ignored. |
No |
empty, 1970-2099 | , - * / |
|
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 |
Has different meaning in each of the two fields in which it is allowed. The value
When using the |
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 * * ? 2020
= 8, 9 and 10 o'clock of every day during the year 2020.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 day of the week it is.0 15 10 ? * 6L 2022-2025
= 10:15 AM on every Friday of every month during the years 2022, 2023, 2024 and 2025.0 30 11 ? * 6#2
= 11:30 AM on the second Friday of every month.
Warning Quartz cron only supports a value in either the 4th or the 6th position, but not in both. At the same time, both positions cannot be empty.