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
| Field | Time unit | Value range | Allowed special characters |
|---|---|---|---|
| 1 | Seconds | 0–59 | - * / |
| 2 | Minutes | 0–59 | - * / |
| 3 | Hours | 0–23 | - * / |
| 4 | Day of month | 1–31 | - * ? / L W C |
| 5 | Month | 1–12 or JAN–DEC | JAN-DEC - * / |
| 6 | Day of week | 0–7 or SUN–SAT | SUN-SAT - * ? / L C # |
| 7 (optional) | Year | Empty or 1970–2199 | , - * / |
Special characters
| Character | Meaning | Example |
|---|---|---|
* | All values in the field | Minutes = * triggers every minute |
? | Any value; use in Day of month or Day of week to avoid conflict between the two fields | 13 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 values | Minutes = 5-20 triggers every minute from :05 to :20 |
/ | Start value and step interval | Minutes = 5/20 triggers at :05, :25, and :45 |
, | A list of values | Minutes = 5,20 triggers at :05 and :20 |
L | Last day or weekday of the month; use in Day of month or Day of week | Day of week = 5L triggers on the last Thursday of each month |
W | Nearest 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. |
LW | Last 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.
| Schedule | Expression |
|---|---|
| Every 2 hours | 0 0 */2 * * ? |
| At 1 AM every day | 0 0 1 * * ? |
| At 11 PM every day | 0 0 23 * * ? |
| At 12 PM every day | 0 0 12 * * ? |
| At 10:15 AM every day | 0 15 10 ? * * |
| At 10:15 AM every day | 0 15 10 * * ? |
| At 10:15 AM every day | 0 15 10 * * ? * |
| At 12 AM, 1 PM, 6 PM, and 9 PM every day | 0 0 0,13,18,21 * * ? |
| At 10 AM, 2 PM, and 4 PM every day | 0 0 10,14,16 * * ? |
| At 10:15 AM, Monday through Friday | 0 15 10 ? * MON-FRI |
| At 12 PM every Wednesday | 0 0 12 ? * WED |
| At 1 AM every Sunday | 0 0 1 ? * L |
| At 2 AM on the 1st of each month | 0 0 2 1 * ? |
| At 1 AM on the 1st of each month | 0 0 1 1 * ? |
| At 10:15 AM on the 15th of each month | 0 15 10 15 * ? |
| At 10:15 AM on the last day of each month | 0 15 10 L * ? |
| At 11 PM on the last day of each month | 0 0 23 L * ? |
| At 10:15 AM on the last Friday of each month | 0 15 10 ? * 6L |
| At 10:15 AM on the last Friday of each month, 2025–2026 | 0 15 10 ? * 6L 2025-2026 |
| At 10:15 AM on the third Friday of each month | 0 15 10 ? * 6#3 |
| At 10:15 AM every day in 2025 | 0 15 10 * * ? 2025 |
该文章对您有帮助吗?