News for hackers. Stuff that matters.
Re:Australia/Lord_Howe is the weirdest timezone by tankenmate on Wednesday October 30, 2024 @05:29AM (#41993210)
"Running cron jobs on an hourly basis doesn’t in practice have very weird interactions with DST"

Of course every sane person runs their default system clock on UTC and lets users pick their own local time. That way cron always does the "right thing"(TM).

Re:Australia/Lord_Howe is the weirdest timezone by rubenv on Wednesday October 30, 2024 @06:57AM (#41993575)
That's true if you need to clean up temporary files every night or make a backup.

But what if your cronjob has an effect in the physical world, locally? E.g. open the parking gates every morning.

The world is inherently messy :-)

Re:Australia/Lord_Howe is the weirdest timezone by roryirvine on Wednesday October 30, 2024 @07:50AM (#41993893)
That sort of thing would be best handled by your own user's crontab, so would naturally inherit that user's TZ.

If you must run it as root, you can specify a CRON_TZ variable on a per-file basis, which will override the default.

Re:Australia/Lord_Howe is the weirdest timezone by tankenmate on Wednesday October 30, 2024 @07:58AM (#41993930)
Well assuming that the gates don't move timezones. But obviously jobs that need to run for a given timezone should be configured to run in that timezone.
Re:Australia/Lord_Howe is the weirdest timezone by cube00 on Wednesday October 30, 2024 @08:02AM (#41993955)
Unless the gates need to open at 2:30am and in the case of daylight savings time that hour is skipped.
Re:Australia/Lord_Howe is the weirdest timezone by tankenmate on Wednesday October 30, 2024 @09:32AM (#41994563)
Not if that cron file (you can have multiple cron files per user/system) is configured to run in the local timezone.
Re:Australia/Lord_Howe is the weirdest timezone by sib on Wednesday October 30, 2024 @01:48PM (#41998124)
But then wouldn't the job run twice when time "falls back"?
Re:Australia/Lord_Howe is the weirdest timezone by tankenmate on Wednesday October 30, 2024 @06:48PM (#42001377)
no, it would run either twice at the "same time" as it is read out, but obviously 60 minutes apart time duration wise; but this can't be helped as this time "existed" twice in that time zone. Or conversely in spring that time wouldn't happen at all, but the cron job will still run 60 minutes apart time duration wise. But this is the downside of local time, just make sure if you want to open a door at 01:30 local time that that is what you really want, because the unintended consequences could be a bit strange.
Re:Australia/Lord_Howe is the weirdest timezone by cesarb on Wednesday October 30, 2024 @10:25AM (#41995265)
> That's true if you need to clean up temporary files every night or make a backup.

Making a backup is usually reserved for the quietest hours of the morning, so that it does not compete as much for resources with the normal operation of the system; in my experience, the quietest hour is usually around 4:00 local time.

Re:Australia/Lord_Howe is the weirdest timezone by sgarland on Wednesday October 30, 2024 @08:38AM (#41994180)
Tangentially, Debian’s vixie-cron did / does handle DST, but it did not handle TZ changes [0], as I discovered.

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019716