Imagine wondering “When’s the next time that Christmas will be a Tuesday/Wednesday, for those sweet optimal public holidays (Jan 1st being exactly a week later)?”

Now imagine asking, idk, google or Siri or god forbid an actual calendar, instead of turning to the best tool for the job: systemd.

#systemd #linuxadmin #linux #systemd

@rixx Oh no, now systemd is taking over the calendar. Is there nothing sacred anymore?

@lambisio Yeah, well, I’m feeling conflicted bth. On the one hand, yes, systemd is eating everything.

On the other hand, this is for systemd-timers, and they are just so *nice*.

@rixx True but the implications of setting a systemd timer for "when Christmas is on a Tuesday" are terrifying.

@lambisio

@xahteiwi @lambisio I’ll grant you this one, but, like, that’s just the consequence of being able to select *either* a date or a weekday, which isn’t too wild.

@rixx Right, "do something every Friday the 13th" sounds very useful too.

@lambisio

@xahteiwi @rixx To my recollection crontab can do that.

@lambisio @xahteiwi Not sure – I thought "* * 13 * 5" meant "both on Fridays and on the 13th of each month", and https://crontab.guru/#0_0_13_*_5 agrees.

In any case a huge advantage of systemd timers is your ability to query them for next / scheduled / past runs like this fwiw.

Crontab.guru - The cron schedule expression generator

An easy to use editor for crontab schedules.

@rixx @xahteiwi That's weird. I mean, 30 6 * * * means "at 6:30" and not "every half hour and also at 6:00". So it'd be extra weird if dow/dom were specialcased that way.

But even then, that doesn't justify "solving" the problem by subsuming it into systemd. Pretty sure there's like at leats other 200 tools to do the job.

(No, NTP is *not* one of them!)

@lambisio @xahteiwi Right, well, in that case, I’m afraid I have no justification to offer (lol)
@lambisio @rixx @xahteiwi I'm deeply into that shit at work at the moment, and I tell you in cron DoW *and* DoM both match, which is crazy. So "1-7 * Fri" means every Friday and also the 1st-7th of the month.