Preventing Cron Job Failures Across Timezones and UTC

Written by Raheel Ikram | Updated December 5, 2026 | Reading time: 4 minutes

Scheduling a daily billing script at 0 2 * * * (2:00 AM) on a server configured in a regional timezone causes the job to disappear completely in spring and run twice in autumn. Every cron daemon follows its host timezone unless you set UTC explicitly.

Three Rules for Reliable Cron Jobs

  1. Set CRON_TZ=UTC at the top of your crontab: Running background infrastructure in UTC guarantees 86,400-second days with zero DST jumps.
  2. Use file locks or database idempotency keys: Wrap long scripts with Linux flock so an overlapping run never processes duplicate invoices.
  3. Handle business hours in application logic: If a report must arrive at 9:00 AM New York time, trigger an hourly UTC cron job that checks America/New_York inside Python or Node.js before sending.
# Explicit UTC crontab example with overlap lock
CRON_TZ=UTC
0 6 * * * /usr/bin/flock -n /tmp/billing.lock /usr/bin/python3 /opt/jobs/billing.py
About the Author: Raheel Ikram

Creator of Timestamp Converter, writing practical guides on timekeeping, SQL schema design, and web utilities. Read full bio.