Configure job schedules

Write a schedule in cron format, run it in any time zone, and know what happens when clocks change.

A job’s schedule says when it runs, and its timeZone says in which time zone. This page shows how to write both. For every accepted value, see Schedules.

Cron format

A schedule has 5 fields, separated by spaces:

┌───────────── minute        0 to 59
│ ┌─────────── hour          0 to 23
│ │ ┌───────── day of month  1 to 31
│ │ │ ┌─────── month         1 to 12, or JAN to DEC
│ │ │ │ ┌───── day of week   0 to 6, or SUN to SAT. 7 is also Sunday
│ │ │ │ │
0 2 * * *

Each field takes a value, a range (1-5), a list (1,15), a step (*/15), or * for every value.

ScheduleRuns
*/15 * * * *Every 15 minutes
0 2 * * *Every day at 2:00
30 8 * * MON-FRIAt 8:30 on weekdays
0 0 1 * *At midnight on the first of each month
0 9 1 JAN,JUL *At 9:00 on 1 January and 1 July

These shortcuts also work: @hourly, @daily, @weekly, @monthly, and @yearly.

Time zones

A schedule runs in the job’s timeZone, an IANA name such as Africa/Dar_es_Salaam or Europe/London. Without one, it runs in UTC.

To check a schedule before you save it, ask for its next 5 run times:

curl -X POST "https://scheduler-api.digitospace.com/v1/schedules/preview" \
  -H "Authorization: Bearer $SCHEDULER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "schedule": "30 8 * * MON-FRI", "timeZone": "Africa/Dar_es_Salaam" }'

When clocks change

In time zones with daylight saving time:

  • When clocks go forward, a time that does not exist that day is skipped.
  • When clocks go back, a time that happens twice runs once, the first time.

Missed runs

If a job misses some of its times, only the latest missed run happens. The run’s skippedBefore counts the others, so a burst of catch-up calls never reaches your target.

Last updated