Ormus Cases ormus.solutions
Case 05 · Scheduling

46 cron lines named a time zone

“The time is out of joint. O cursed spite, / That ever I was born to set it right.”

William Shakespeare · Hamlet, Act 1, Scene 5 (Project Gutenberg)

One of my servers runs 75 cron jobs. 46 of them start with an inline TZ=, 11 of those with TZ=America/Panama. In cronie, an inline TZ= only sets the environment of that one command. When the job fires comes from the host clock, here Chicago, or from a CRON_TZ line. Today Panama and Chicago are both UTC-5, so nothing shows. On Sunday 1 Nov, Chicago moves to UTC-6 and those 11 jobs will read a clock one hour ahead of the one that fires them.

0:00 / 1:16
Status · Found, one part fixedThe posting job already uses CRON_TZ=America/Chicago, and the one time guard I found was moved to Chicago on 3 Oct. The 11 inline Panama lines are unchanged as of 8 Oct and are due for a fix before 1 Nov.
01 · The claim

The crontab, in four numbers

75

Job lines in one crontab, on a host whose clock is set to America/Chicago, running cronie 1.7.2.

46

Lines that set TZ= inline: 35 to America/Chicago, which matches the host, and 11 to America/Panama.

1

CRON_TZ line. It is the only setting in the file that changes when jobs fire, and it covers the posting job.

1 hour

How far the 11 Panama jobs will read ahead of their fire time from 1 Nov, when Chicago leaves daylight time.

02 · Transcript

Transcript

0:01My crontab names a time zone two ways. 46 of 75 lines use TZ= inline.
0:14In cronie, CRON_TZ sets when the jobs below it fire.
0:20An inline TZ= only sets the environment of that one command.
0:30On Sunday 1 Nov, Chicago moves to UTC-6. Panama stays at UTC-5.
0:36At 6 PM in Chicago, a job with TZ=America/Panama reads 19:00.
0:41The 11 Panama jobs still fire on Chicago time, with a clock an hour ahead.
0:46My audit found a guard that exits outside 8 to 18, Panama time.
0:52It would have skipped the last run every day. It moved to Chicago on 3 Oct.
1:00The fix is one CRON_TZ line where cron reads it.
1:05The posting job has it. The 11 Panama lines are next, before 1 Nov.
03 · Sources

Sources and honest limits

This is read from the crontab and the cronie manual, and the clock math was checked with date on 8 Oct. I have not watched a job across the 1 Nov change. Whether one hour matters depends on what each of the 11 jobs does with the time; most run overnight and may not care. The 35 inline Chicago lines are harmless because they match the host. A Grok routine follows the same rule: its schedule uses the app time zone unless prefixed with CRON_TZ. Host names are left out.

Our solution.