Cron expressions

更新时间:
复制 MD 格式

Cron expressions control when scheduled tasks run in IDaaS EIAM. Each expression contains 6 or 7 space-separated fields, each representing a time unit.

Warning

Cron expressions in the IDaaS identity provider require intervals of at least 1 hour. Set intervals appropriately to match your data synchronization frequency.

Syntax

┌─────────────── Seconds   (0–59)
│ ┌───────────── Minutes   (0–59)
│ │ ┌─────────── Hours     (0–23)
│ │ │ ┌───────── Day of month  (1–31)
│ │ │ │ ┌─────── Month    (1–12 or JAN–DEC)
│ │ │ │ │ ┌───── Day of week   (0–7 or SUN–SAT)
│ │ │ │ │ │ ┌─── Year     (1970–2199, optional)
│ │ │ │ │ │ │
* * * * * * *

Both 0 and 7 represent Sunday in the Day of week field. The Year field can be left blank.

Allowed values and special characters

FieldTime unitValue rangeAllowed special characters
1Seconds0–59- * /
2Minutes0–59- * /
3Hours0–23- * /
4Day of month1–31- * ? / L W C
5Month1–12 or JAN–DECJAN-DEC - * /
6Day of week0–7 or SUN–SATSUN-SAT - * ? / L C #
7 (optional)YearEmpty or 1970–2199, - * /

Special characters

CharacterMeaningExample
*All values in the fieldMinutes = * triggers every minute
?Any value; use in Day of month or Day of week to avoid conflict between the two fields13 13 15 20 * ? triggers on the 20th of each month regardless of the day of week. Because Day of month is already set to 20, Day of week must use ?, not *.
-A range of valuesMinutes = 5-20 triggers every minute from :05 to :20
/Start value and step intervalMinutes = 5/20 triggers at :05, :25, and :45
,A list of valuesMinutes = 5,20 triggers at :05 and :20
LLast day or weekday of the month; use in Day of month or Day of weekDay of week = 5L triggers on the last Thursday of each month
WNearest business day (Monday–Friday) to the specified date; use in Day of month only. Limited to the current month.Day of month = 5W: if the 5th is Saturday, triggers on the 4th (Friday); if the 5th is Sunday, triggers on the 6th (Monday); if the 5th is a business day, triggers on that day.
LWLast business day of the month, which is the last Friday
#Nth occurrence of a weekday in the month; use in Day of week only.Day of week = 4#2 triggers on the second Wednesday of each month (4 = Wednesday, 2 = second occurrence)

Examples

Note

Adjust the time parameters, including the year, to match your requirements.

ScheduleExpression
Every 2 hours0 0 */2 * * ?
At 1 AM every day0 0 1 * * ?
At 11 PM every day0 0 23 * * ?
At 12 PM every day0 0 12 * * ?
At 10:15 AM every day0 15 10 ? * *
At 10:15 AM every day0 15 10 * * ?
At 10:15 AM every day0 15 10 * * ? *
At 12 AM, 1 PM, 6 PM, and 9 PM every day0 0 0,13,18,21 * * ?
At 10 AM, 2 PM, and 4 PM every day0 0 10,14,16 * * ?
At 10:15 AM, Monday through Friday0 15 10 ? * MON-FRI
At 12 PM every Wednesday0 0 12 ? * WED
At 1 AM every Sunday0 0 1 ? * L
At 2 AM on the 1st of each month0 0 2 1 * ?
At 1 AM on the 1st of each month0 0 1 1 * ?
At 10:15 AM on the 15th of each month0 15 10 15 * ?
At 10:15 AM on the last day of each month0 15 10 L * ?
At 11 PM on the last day of each month0 0 23 L * ?
At 10:15 AM on the last Friday of each month0 15 10 ? * 6L
At 10:15 AM on the last Friday of each month, 2025–20260 15 10 ? * 6L 2025-2026
At 10:15 AM on the third Friday of each month0 15 10 ? * 6#3
At 10:15 AM every day in 20250 15 10 * * ? 2025