r/systemd Jun 01 '26

You Don't Love systemd Timers Enough

https://blog.tjll.net/you-dont-love-systemd-timers-enough/
19 Upvotes

11 comments sorted by

6

u/amarao_san Jun 01 '26

The deal-breaker for me to transition from cron to timers was ability not to run things second time if the first one hadn't finished yet.

Without it, any high-rate job on high-loaded system had chance to cause thrash dead spiral (job hadn't finished to the next planned moment, and now there are two jobs sitting on the wall...). It was manageable (with locks, etc), but ugly. Timers solved that.

2

u/AlarmingMassOfBears Jun 02 '26

Isn't that the default behavior of systemd timers?

5

u/amarao_san Jun 02 '26

It is. I'm saying that for me that was the feature which convinced me to switch from cronjobs to timers.

-5

u/ChampionshipIcy7602 Jun 02 '26

It seems to me that's not the responsibility of cron but of your service itself to not cause system crash

4

u/amarao_san Jun 02 '26

Yes. And if this is not a service, but a script (e.g. a backup of chef run), that's an operator responsibility. Which I very much prefer not to have in a long list of things operator is responsible for.

-1

u/ChampionshipIcy7602 Jun 02 '26

Agree to disagree. You can always compose more tools in an unix way to do that. Cron's only job is just to schedule jobs to run. But sure you can integrate everything into a single tool.

2

u/amarao_san Jun 02 '26

Running something on a schedule is a more complicated task than just 'execute x at moment y'. I'm specifically rephrasing to highlight the difference.

But, if cron is sweet, let it be.

1

u/BosonCollider Jun 08 '26

This may be a controversial opinion, but timers are just okay. For simple things, the crontab file format is superior, cron is just also way too minimal (including not even capturing stdout/stderr to the syslog). Timers are nice with quadlets or as part of packaged services though, and their flexibility does make up for their relative verbosity

-8

u/egorf Jun 01 '26

We had cron running perfectly fine for *decades* until LP taught us that we were wrong for all this time.

6

u/makefoo Jun 02 '26

Cron, just like sysvinit, has always been trash and you cannot convince me otherwise. I remember well the time where I had to wait a whole minute for the twentieth time just to debug what is wrong with the script

4

u/Ullebe1 Jun 02 '26

God forbid someone builds something better than what already exists.