Use cron expressions to schedule Cloud Assistant commands with flexible time-based triggers.
Basic syntax of cron expressions
A cron expression is a string of six or seven fields that defines a job schedule.
Format:
Seconds Minutes Hours Day-of-month Month Day-of-week [Year]
-
<Year> is optional.
-
For a single field:
-
Each field accepts specific values, ranges, increments, or special characters.
-
Separate multiple values with a comma (
,). -
Each field allows at most one leading zero. For example, 01 is valid but 001 is not.
-
See Valid values of fields and Examples for value ranges and special characters.
Valid values of fields
The following table lists the value range and special characters for each field.
|
Field |
Required |
Value range |
Special characters |
|
Seconds |
Yes |
[0, 59] |
* , - / |
|
Minutes |
Yes |
[0, 59] |
* , - / |
|
Hours |
Yes |
[0, 23] |
* , - / |
|
Date |
Yes |
[1, 31] |
* , - / ? L W |
|
Month |
Yes |
[1, 12] or [JAN, DEC] |
* , - / |
|
Day-of-week |
Yes |
[1, 7] or [MON, SUN]. In Cloud Assistant commands, if you use the [1, 7] format, Important
Cron expression semantics vary by system. Outside Cloud Assistant, 1 may indicate Sunday and 7 may indicate Saturday. |
* , - / ? L # |
|
Year |
No |
[Current year, 2099] |
* , - / |
Special characters
The following table describes each special character and its meaning.
|
Special character |
Meaning |
Example |
|
|
All values. |
In |
|
|
A list of enumeration values. |
In |
|
|
A range of values. |
In |
|
|
An increment from a start value. |
In |
|
|
Unspecified value. Used only in the Day-of-month and Day-of-week fields. |
If you specify a value in either |
|
|
Last day. Supported only in the Important
Do not combine |
|
|
|
Nearest weekday (Monday to Friday) to a specified day. Does not cross month boundaries. |
In |
|
|
The Nth occurrence of a weekday in the month. Important
Supported only in the |
In |
Examples
|
Scenario |
Value |
|
|
Run a task at a specific time daily. |
Run the task at 10:15 daily. |
|
|
Run the task at 12:00 daily. |
|
|
|
Run a task at specific times daily. |
Run the task at 10:00, 14:00, and 16:00 daily. |
|
|
Run a task at a fixed interval. |
Run the task every 30 minutes from 09:00 to 17:00 daily. |
|
|
Run the task every minute from 14:00 to 14:59 daily. |
|
|
|
Run the task every minute from 14:00 to 14:05 daily. |
|
|
|
Run the task every 5 minutes from 14:00 to 14:55 daily. |
|
|
|
Run the task every 5 minutes from 14:00 to 14:55 and from 18:00 to 18:55 daily. |
|
|
|
Run a task on specific days of the month or week. |
Run the task at 12:00 every Wednesday. |
|
|
Run the task at 10:15 on the 15th day of every month. |
|
|
|
Run the task at 10:15 on the last day of every month. |
|
|
|
Run the task at 10:15 on the last Saturday of every month. |
|
|
|
Run the task at 10:15 on the 3rd Saturday of every month. |
|
|
|
Run a task on specific days in specific years. |
Run the task at 14:10 and 14:44 every Wednesday in March every year. |
|
|
Run the task at 10:15 daily in 2022. |
|
|
|
Run the task at 10:15 daily, every year. |
|
|
|
Run the task every 5 minutes from 14:00 to 14:55 and from 18:00 to 18:55 daily in 2022. |
|
|
|
Run the task at 10:15 on the 3rd Saturday of every month in 2022 and 2023. |
|
|
|
Run the task every 30 minutes from 9:00 to 17:30 daily from 2022 to 2025. |
|
|
|
Run the task at 14:10 and 14:44 every Wednesday in March every 2 years starting from 2022. |
|
|