Cron style lets you set a schedule that the preset intervals in the panel do not cover. The schedule is written as five values separated by spaces, each saying when the task should run. See Scheduled tasks (cron) in KeyHelp for creating the task itself.
The five fields
| Position | Field | Allowed values |
|---|---|---|
| 1 | Minute | 0–59 |
| 2 | Hour | 0–23 |
| 3 | Day of month | 1–31 |
| 4 | Month | 1–12 |
| 5 | Day of week | 0–7 (0 and 7 are Sunday) |
Within a field you can use:
*— every value;5— one specific value;20,30— several values;1-5— a range;*/15— a step, meaning every 15th value.
Examples
* * * * * | Every minute |
0 0 * * * | Every day at midnight |
5 * * * * | Five minutes past every hour |
*/15 * * * * | Every 15 minutes |
0 * 15 * * | On the 15th of the month, every hour |
15 20 * * 6 | Every Saturday at 20:15 |
20,30 1 * * 1-5 | Monday to Friday at 1:20 and 1:30 |
Keywords
The five fields can be replaced by a single keyword:
| Keyword | Meaning | Equivalent |
|---|---|---|
@reboot | Once at system start | — |
@hourly | Once an hour | 0 * * * * |
@daily / @midnight | Once a day | 0 0 * * * |
@weekly | Once a week | 0 0 * * 0 |
@monthly | Once a month | 0 0 1 * * |
@annually / @yearly | Once a year | 0 0 1 1 * |
Two things that catch people out
Day of month and day of week together. If both fields are set to something other than *, the task runs when either matches, not both. So 0 0 13 * 5 runs on the 13th of every month and on every Friday — not only on Friday the 13th.
Steps start from zero, not from now. */15 in the minute field means minutes 0, 15, 30 and 45 — not "15 minutes from when I saved this".
Before you choose every minute
A job running every minute is rarely necessary and quietly costs resources — especially if the previous run has not finished when the next one starts. Ask what the longest acceptable delay is and use that; every 5 or 15 minutes is enough for almost everything.
If you are not sure the schedule you have written means what you intend, describe in a ticket when the task should run and we will check it.