Example Files (Documentation, Helm, Config etc)
Cron Expression Guide
Cron expressions are used to schedule tasks at periodic intervals. A cron expression is made up of five fields, each representing a unit of time. Below is a table outlining the structure of a cron expression and the values each field can take:
Field | Allowed Values | Description |
---|---|---|
Minute | 0-59 | The minute of the hour |
Hour | 0-23 | The hour of the day |
Day of the Month | 1-31 | The day of the month |
Month | 1-12 | The month of the year |
Day of the Week | 0-6 | The day of the week (0 = Sunday) |
Each field can be an asterisk (*
), which stands for "every" possible value for that field.
Examples of Cron Expressions
Here are some common cron expression examples and their corresponding schedules:
Cron Expression | Schedule Description |
---|---|
* * * * * | Every minute |
0 * * * * | Every hour, at the start of the hour |
0 0 * * * | Every day at 12:00 AM (midnight) |
0 0 * * FRI | Every Friday at 12:00 AM (midnight) |
0 0 1 * * | The first day of every month at 12:00 AM (midnight) |
These examples illustrate how to use cron expressions to schedule tasks at various intervals, from every minute to specific days of the week or month.