Schedule syntax
Two shapes: every <interval> and at <time>.
Intervals
schedule = "every 5m" schedule = "every 90s" schedule = "every 6h" schedule = "every 2d"
An interval is measured from the moment sundial serve started, not from midnight.
If you need a run aligned to the clock, use at.
Wall-clock times
schedule = "at 03:17" # every day schedule = "at 03:17 on mon,thu" # two days a week schedule = "at 00:00 on day 1" # first of the month schedule = "at 09:00,13:00,17:00" # three times a day
Weekday names are the first three letters, lower case:
mon tue wed thu fri sat sun. day N is the day of the month; a job set for
day 31 simply does not run in months that do not have one — it is not moved.
Time zones and DST
Schedules are evaluated in the host's local zone unless the job sets one:
job "report" {
run = "/opt/report/daily"
schedule = "at 06:00"
tz = "Europe/Berlin"
}
On the day a zone moves to summer time, a job scheduled inside the skipped hour
does not run; on the day it moves back, a job inside the repeated hour runs once.
Both are recorded in the log with a
dst note. If a job must run exactly N times a day
regardless, schedule it in UTC.Checking before you deploy
$ sundial check backup at 03:17 on mon,thu next: Thu 03:17, Mon 03:17, Thu 03:17, Mon 03:17, Thu 03:17 report at 06:00 (Europe/Berlin) next: Tue 06:00, Wed 06:00, Thu 06:00, Fri 06:00, Sat 06:00 prune every 6h next: 14:22, 20:22, 02:22, 08:22, 14:22 3 jobs, 0 problems
check exits non-zero if anything fails to parse, which makes it a reasonable thing
to run in CI against the config file.