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 that will be described in this section.

For example, 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.

For example, 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 Cloud stops responding.

The Cron pattern consists of six or seven space-separated fields:

<second> <minute> <hour> <day of the month> <month> <day of the week> <year>

Position

Field

Description

Mandatory

1

second

This field determines the second of the schedule:

  • <second>: at the entered second. The value must be between 0 and 59, included.
  • */<second>: every <second> seconds. For example, */10 corresponds to every 10 seconds.

Yes

2

minute

This field determines the minute of the schedule:

  • minute: at the entered minute. The value must be between 0 and 59, included.
  • minute/minute: on the given minutes, values included. For example, 15/45 corresponds to every hour at 15 and 45 minutes past the hour.
  • */minute: every <minute> minutes. For example, */15 corresponds to every 15 minutes.

Yes

3

hour

This field determines the hour of the schedule:

  • hour: at the entered hour. The value must be between 0 and 23 included.
  • hour-hour: range of hours, values included. For example, 8-10 means at 8,9 and 10 o'clock.
  • hour,hour: at the given hours. For example, 6,18 means at 6 AM and at 6 PM.

Yes

4

day of the month

This field determines the day of the schedule:

  • day: at the entered day of the month. The value must be between 1 and 31 included.
  • day-day: range of days of the month, values included. For example, 1-4 corresponds to every first four days of the month.
  • day,day: at the given days of the month. For example, 1,15 corresponds to the first day of the month and the 15th day of the month.
  • L: at the last day of the month.
  • dayW: at the nearest weekday (Monday to Friday). For example, the 15th day is a Saturday, then value 15W corresponds to the 14th day of the month, which is a Friday. If the 15th day is a Sunday, then value 15W corresponds to the 16th day, which is a Monday. If the 15th day is a Monday, Tuesday, Wednesday, Thursday or Friday, then value 15W corresponds to the 15th day.
    Note If the 1st day of the month is a Saturday, then 1W corresponds to the 3rd day of the month, since the month is specified in the 5th value of the Cron expression.
  • LW: at the last weekday of the month.

Yes

5

month

This field determines the month of the schedule:

  • month: at the entered month of the year. The value must be between 1 and 12, included. You can also use the first three characters of the English names, JAN, FEB, MAR and so on.
  • month-month: range of months, values included. For example, 1-3 corresponds to every first three months of the year.
  • month,month: at the given months of the year. For example, APR,AUG,DEC corresponds to every April, August and December of the year.

Yes

6

day of the week

This field determines the day of the week of the schedule:

  • day of the week: at the entered day of the week. The value must be between 1 and 7, included, respectively corresponding to Sunday and Saturday. You can also use the first three characters of the English names, MON, TUE, WED and so on.
  • day of the week-day of the week: range of days of the week, values included. For example, 2-6 corresponds to Monday to Friday.
  • day of the week,day of the week: on the given days of the week. For example, MON,WED,FRI corresponds to every Monday, Wednesday and Friday.
  • L: on Saturday, the 7th day of the week.
  • L-day of the week: at the given day before the end of the week. For example, L-3 corresponds to the third to last day of the month.
  • day of the weekL: at the last given day of the month. For example, 2L corresponds to the last Monday of the month.
  • day of the week#nr of day of the month: at the given day of the month. For example, 6#3 corresponds to the 3rd Friday of the month.

Yes

7

year

This field determines the year of the schedule:

  • <empty>: if your schedule doesn't require a year, you can leave this value empty.
  • year: at the entered year. The value must be between 1970 and 2099. For example, 2020 corresponds to the year 2020.
  • year-year: range of years, values included. For example, 2020-2025 corresponds with the years 2020, 2021, 2022, 2023, 2024 and 2025.
  • year,year: on the given years. For example, 2020,2022,2025 corresponds to the years 2020, 2022 and 2025.

No

Non-standard characters

  • asterisk (*): Used to select all values within a field. For example, "*" in the minute field corresponds with every minute.
  • question mark (?): 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. For 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.
Example 
  • 0 0 * ? * * * = the top of every hour of every day.
  • */10 * * * * ? = every ten seconds.
  • 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.