Skip to content

Commit df69d3c

Browse files
committed
Cron schedule syntax and examples added
removed the reboot entry, since it is non standard scheudle syntax and not related to cron syntax for scheduling
1 parent 6d72006 commit df69d3c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

content/en/docs/concepts/workloads/controllers/cron-jobs.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,37 @@ This example CronJob manifest prints the current time and a hello message every
5151
([Running Automated Tasks with a CronJob](/docs/tasks/job/automated-tasks-with-cron-jobs/)
5252
takes you through this example in more detail).
5353

54+
### Cron schedule syntax
55+
56+
```
57+
# ┌───────────── minute (0 - 59)
58+
# │ ┌───────────── hour (0 - 23)
59+
# │ │ ┌───────────── day of the month (1 - 31)
60+
# │ │ │ ┌───────────── month (1 - 12)
61+
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
62+
# │ │ │ │ │ 7 is also Sunday on some systems)
63+
# │ │ │ │ │
64+
# │ │ │ │ │
65+
# * * * * *
66+
```
67+
68+
69+
| Entry | Description | Equivalent to |
70+
| ------------- | ------------- |------------- |
71+
| @yearly (or @annually) | Run once a year at midnight of 1 January | 0 0 1 1 * |
72+
| @monthly | Run once a month at midnight of the first day of the month | 0 0 1 * * |
73+
| @weekly | Run once a week at midnight on Sunday morning | 0 0 * * 0 |
74+
| @daily (or @midnight) | Run once a day at midnight | 0 0 * * * |
75+
| @hourly | Run once an hour at the beginning of the hour | 0 * * * * |
76+
77+
78+
79+
For example, the line below states that the task must be started every Friday at midnight, as well as on the 13th of each month at midnight:
80+
81+
`0 0 13 * 5`
82+
83+
To generate CronJob schedule expressions, you can also use web tools like [crontab.guru](https://crontab.guru/).
84+
5485
## CronJob limitations {#cron-job-limitations}
5586

5687
A cron job creates a job object _about_ once per execution time of its schedule. We say "about" because there

0 commit comments

Comments
 (0)