Skip to main content

Understand Cron Expressions

A cron expression defines when a scheduled scaling task runs. Zilliz Cloud uses the standard five-field Unix cron format with minute-level granularity. Cron schedules are evaluated in the timezone you select.

plaintext
* * * * *
│ │ │ │ └── day of week
│ │ │ └──── month
│ │ └────── day of month
│ └──────── hour
└────────── minute
FieldValid value rangeNotes
minute0 to 59Minute of the hour.
hour0 to 23Uses a 24-hour clock.
day of month1 to 31If a month does not have the specified day, the schedule does not run in that month.
month1 to 12Month of the year.
day of week0 to 60 represents Sunday, 1 represents Monday, and so on.

Supported operators

OperatorMeaningExample
*Any value.* * * * * runs every minute.
,List of values.0 9,17 * * * runs at 09:00 and 17:00 every day.
-Range of values.0 9-17 * * * runs hourly from 09:00 through 17:00.
/Step values.*/5 * * * * runs every 5 minutes.

Common cron templates

Use caseCron expressionMeaning
Daily at 09:3030 9 * * *Runs at 09:30 every day.
Weekdays at 09:000 9 * * 1-5Runs at 09:00 from Monday to Friday.
Every Sunday at 09:000 9 * * 0Runs at 09:00 every Sunday.
Twice daily0 9,21 * * *Runs at 09:00 and 21:00 every day.
Monthly on the 1st at 09:000 9 1 * *Runs at 09:00 on the first day of every month.

Example schedules

Scale up during weekday peak hours and scale down after work

Create two schedules: one to scale up before peak hours and one to scale down after peak hours.

ScheduleCron expressionTarget
Scale up at 09:00, Monday to Friday0 9 * * 1-5Set Query CU or replica to the peak-hour target.
Scale down at 19:00, Monday to Friday0 19 * * 1-5Set Query CU or replica to the off-peak target.

Use lower resources on weekends and restore on Monday

Create one schedule to scale down on Saturday and one schedule to restore capacity on Monday.

ScheduleCron expressionTarget
Scale down every Saturday at 00:000 0 * * 6Set Query CU or replica to the weekend target.
Restore every Monday at 09:000 9 * * 1Set Query CU or replica to the weekday target.
Ctrl I