Schedule cron in UTC
A crontab entry with no zone fires on the host's local clock, so a 30 2 * * * job runs at a different instant after every DST shift and on every host with a different TZ. Pin the zone once and reason in UTC.
Procedure
- Read what the scheduler actually does today:
crontab -l; systemctl list-timers --all; cat /etc/cron.d/* 2>/dev/null
- Force the zone in the crontab. Vixie cron honours
CRON_TZ; Debian/Ubuntu cron honoursTZ; set the one your daemon reads at the top of the file:
CRON_TZ=UTC
30 2 * * * /usr/local/bin/rollup.sh >> /var/log/rollup.log 2>&1
- For systemd,
OnCalendardefaults to local time — append the zone explicitly:
[Timer] 02:30:00 UTC
Persistent=true
- Express business-local jobs deliberately. If the job must run at 02:30 local in New York, say so and expect the UTC instant to move twice a year:
TZ=America/New_York
30 2 * * * /usr/local/bin/rollup.sh
- Confirm the host zone when a job cannot be forced:
timedatectl; date; date -u
- Check the next fire instant before trusting it, not after the job misses:
systemd-analyze calendar --iterations=3 "*-*-* 02:30:00 UTC"
- Record the chosen convention in the runbook: "all timers are UTC unless the entry names a zone."
Pitfalls
- The 02:00-03:00 window is exactly where US DST jumps. A job at
30 2 * * *local is skipped on spring-forward day and runs twice on fall-back if the daemon retries. CRON_TZis absent on BusyBox and some BSD crons — the line is ignored and the job silently reverts to local. Verify with the next-fire check, not by reading the file.- A container often ships
TZunset = UTC, so a job tested in a container fires an hour off in production whereTZis set in the base image. @daily/@reboottake no time;@dailyis 00:00 local and shifts with DST just like the five-field form.- DST-skipped timers on
OnCalendarare missed unlessPersistent=true, which runs them once on catch-up.
Verification
systemd-analyze calendar --iterations=4 "*-*-* 02:30:00 UTC" | tail -4
Four successive instants that differ by exactly 24h across a DST boundary = the schedule is zone-fixed. Report: "rollup timer pinned to 02:30 UTC; next four fires are 24h apart through the March DST change."