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

“Harry, did you put the Olson database into your init system?”, Dumbledore asked calmly.
(that’s two “Dumbledore asked calmly” posts today, which led to me getting informed that the movie that gave rise to this meme came out 19 years ago, which is WRONG wrong wrong)
@rixx *puts hands over ears* La la la la la la la I can't hear you
@rixx Okay but is it yet able to handle the Hijri and Jewish calendars, is the question.
@rixx I dunno... seems more like something Tom Riddle would do
@rixx "Which one?" Harry replied.
@rixx thanks, I hate it 
@dequbed Right?! It feels so wrong, and yet, systemd-timers are so *nice*. They have a status and know when they will run and when they have run, and you do need to know how to deal with calendars for this.
@rixx yeah it totally makes *sense*, but it feels wrong. I still love systemd for trying to solve the messy real world we live in, but it sure gives rise to a whole lot of unexpected features ^^
@rixx @dequbed this is why I completely ditched cron in favor of systemd timers
@rixx i can't even ....
😂
@leyrer @rixx What's so wrong with systemd? It works fine!
@rixx I'm definitely feeling conflicted by this knowledge.
@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.
@lambisio @rixx
Filing a feature request to include Discordian calendar in systemd right now.

@rixx

Somehow this feels so wrong, but… it works. XD

@rixx @amin what is wrong with the Linux world…
@rixx I’m reading your toot while sitting in the aptly named lounge in the hotel I’m staying tonight…
@rixx @kevin
What font is this? It looks unnaturally clear.
@FritzAdalis Iosevka
GitHub - be5invis/Iosevka: Versatile typeface for code, from code.

Versatile typeface for code, from code. Contribute to be5invis/Iosevka development by creating an account on GitHub.

GitHub

@rixx I love it.

But it's not feature complete until it supports all of remind(1) script.

@rixx

or convince everyone to switch to a 13-month perennial calendar where 25 Dec is always Thursday AND 01 Jan is always Monday

@rixx Wow that's the first useful thing I've ever seen it do!
@megatronicthronbanks gotta try harder with the trolling, among init system wars, this doesn't even register

@rixx This is systemd propaganda! /jk

This feel so wrong, like emojis source code (I love it!)

@catsalad I feel you *so* much, I’ simultaneously shuddering and delighted at the consequences. Cuz, like, timers are obviously better than cronjobs in many-if-not-most cases, and timers need calendars, and … here we are.
@rixx systemd-becauseican
@metaphil systemd-because-timers-and-scheduling-require-calendars klang nicht so gut?
@rixx @catsalad In the name of all that is sacred, why is that real?!?

@schrotthaufen @catsalad Because systemd-timers are an actually really cool thing, but if you implement a scheduling system, you need to understand calendars, to allow people to say "do this every Monday".

(sorry, this is assuming you wanted an answer)

@rixx this doesn't work properly though:

jann@tigerlap:~/linux$ systemd-analyze calendar --base-time='2010-01-01' "*-*-* 23:59:60"
Failed to parse calendar specification '*-*-* 23:59:60': Invalid argument
@rixx
Is there a manpage for this?
@mjsberna Well, presumably `man systemd-analyze`?
@rixx @mjsberna systemd.time(7) documents the documents the format (specifically, the "Calendar Events" section)
@rixx At least it will get you the correct answer. Try asking chatGPT stuff like that 😂🫣

@rixx Want to know why only Apple products are allowed in my house? This. This is why.

(Dear penguinheads, my killfile thirsts for your souls. If you reply I shall feed you to it.)

@kentenmakto I feel you deeply, my troll soul wanted to start the post with "can your initd do THIS"
@rixx Today I learned! Thanks!

@rixx

I actually demonstrated this a few classes ago. As a way to figure out the furthest out you can set a cron job. I think it was on a Wed 29 Feb.

All the LLMs gave a wrong answer.

@rixx ah, yes, the Unix way. love me an atomic, simple tool that does one thing well
@rixx the real question for me is ... how are you able to post this information almost one month in advance?
@zetareserve yeah, the rounding is a bit wild there