this post was submitted on 31 May 2026
83 points (86.7% liked)

Technology

85038 readers
1670 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 3 years ago
MODERATORS
all 34 comments
sorted by: hot top controversial new old
[–] CriticalMiss@lemmy.world 3 points 4 hours ago (1 children)

I dunno, systemd timers seem overcomplicated, cron is simple and universal (as in expected to be on every system install in one of its variants). You only need to learn how to set the time once and if you’re having difficulties setting up time you can use a website crontab.guru

Cron’s simplicity also makes it bulletproof, it just runs things on a schedule, that’s it. You can’t expect it to crash or give you any trouble.

[–] rnkn@lemmy.world 1 points 3 hours ago

I stopped reading when the claim that you shouldn’t use cron was followed with no supporting argument.

[–] Voroxpete@sh.itjust.works 3 points 14 hours ago

OK, yeah, this is awesome. I will definitely be making use of these tricks in future.

[–] Bo7a@piefed.ca 15 points 22 hours ago* (last edited 22 hours ago) (1 children)

I've been doing this stuff for 30 years. The helpful blog post that took 8 pages of text to explain how to schedule a job just made me angry.

I think I am finally into greybeard territory even though my beard made the change a few years ago. Damn.

[–] esc@piefed.social -2 points 21 hours ago (2 children)

Why did it make you angry? Do you believe that there are other implementations that do the task better and simpler?

[–] corsicanguppy@lemmy.ca 2 points 13 hours ago

Do you believe that there are other implementations that do the task better and simpler?

All of 'em. If a joke took 8 pages to explain, it wouldn't be funny either. Lennart's cancer can go, thanks.

[–] Bo7a@piefed.ca 8 points 20 hours ago (2 children)

I was mostly kidding. But the little bit that bothered me was the idea that 'it is so simple here are 8 pages to barely scratch the surface.'

cron works fine for me. And if I ever have to work in an environment where I can't use cron and systemd is available, then of course I will use it. Thus far that has never been the case.

[–] corsicanguppy@lemmy.ca 1 points 13 hours ago* (last edited 13 hours ago)

where I can’t use cron and systemd is available, then of course I will use it

I argue for a 5% cost-of-living adjustment for bad software, and I make sure it's a separate line item so they know it goes away when systemd goes.

[–] psycotica0@lemmy.ca 3 points 18 hours ago

Yeah, I think it's just the way the blog post was written. When I was reading it I saw the first few paragraphs was basically "here's how to do Cron with it", and then everything after that was "here's a bunch of other features it has that cron doesn't and how to use those"

I don't think that's the wrong way to write this kind of article, but I could see it feeling overwhelming on a skim, because it may feel like you need to read the whole thing in order to get anything working. But actually only the start was necessary, and the rest was tasty feature pitch.

[–] 9point6@lemmy.world 29 points 1 day ago

No, I'm pretty sure I love them just the right amount

[–] A_norny_mousse@piefed.zip 16 points 1 day ago (2 children)

Kinda agree; I'm surprised how often people use & recommend cron jobs even on systems that have been using systemd for a decade.

[–] corsicanguppy@lemmy.ca 3 points 13 hours ago

been using systemd

Nah. been used by.

[–] nous@programming.dev 17 points 1 day ago (3 children)

Cron jobs are nice and simple to create. Until they go wrong then they are a pain in the ass. You need to manage logging yourself. If you forget you root mail will fill up your disk and crash the system. If you forget the mailto setting. If you remember it you justlose all logs and have no clue why something is not working. You need to redirect the output to a logfile yourself. And then risk filling up the disk with logs unless you remember to also set up logrotate. And you then still don't know when something last ran or if it ran successfully.

So many traps and that is just the logging side of things.

[–] corsicanguppy@lemmy.ca 2 points 13 hours ago

[your] root mail will fill up your disk and crash the system

If your ~mail/root is more than 0-length, you're missing valuable information.

[–] qupada@fedia.io 11 points 1 day ago (1 children)

My favourite - and I've gotten into arguments with people about this who clearly never just tried it to see what happens - is it never executes things with the shell you think it will.

So many people assume that just because their script says #!/bin/bash at the top that cron is going to run it in bash. The reality is without ALSO setting SHELL=/bin/bash in the crontab file, you're getting your system's lowest-common-denominator shell (ash/dash/sh/whatever other gross abomination).

So much time wasted debugging. And I'm generally pretty good at avoiding shell-specific syntax, I've seen the abominations of shell scripts some people write.

The one thing I do wish systemd timers offered is cron syntax backwards compatibility, rather than just its ISO8601-style time patterns. An every-5-minutes job that used to be */5 * * * * is now OnCalendar=*-*-* *:0/5:0 and I'm just not sure that syntax is universally an improvement.

[–] 4am@lemmy.zip 0 points 20 hours ago

Other than a re-arrangement of the fields, what is the big difference? Harder for awk to work with?

[–] A_norny_mousse@piefed.zip 1 points 1 day ago* (last edited 1 day ago) (2 children)

yes and yes and yes, except:

Cron jobs are nice and simple to create.

So are systemd timers. Seriously. I understood this sort of argument in the years when systemd was relatively new, but nowadays ... c'mon, it's 2 config files in a very simple (the simplest form is just 2 headings with one variable definition each) and common format and (optionally) one command to reload the daemon.

Maybe adding a line to your list of cron jobs is slightly quicker, but you have none of the things systemd offers on top.

OK, tbf I don't know how much (ana)cron provides. Cleaning up the process tree? Restart conditions? Avoiding service duplicates? Advanced starting & repeating like "5min after boot" or "only after this other service has succeeded"? Can it read abbreviations like 'daily' or does it all need to be in that cryptic cron syntax?

[–] nous@programming.dev 11 points 23 hours ago

Its hard to argue that 2 config files both multiple lines long is simpler then a single line in an existing file. Adding a service to cron is just simpler. But adding all the extra bit you are going to want on top increases the things you need to learn to do and configure correctly.

IMO systemd timers are simpler to get right at a little bit more of an upfront cost to learning how they work. But cron is still simpler to just get something working without caring that much. I still find that ends up biting you in the longer term though though all the missing features you need to add manually on top of that one basic line you added.

[–] corsicanguppy@lemmy.ca -4 points 13 hours ago

I understood this sort of argument in the years when systemd was relatively new,

The ageism creeps out of this one.

[–] Simulation6@sopuli.xyz -2 points 11 hours ago (1 children)

I have yet to have a good experience trying to get anything to work with systemd.

[–] isVeryLoud@lemmy.ca 2 points 5 hours ago

Skill issue, my system works fine

[–] GreatBlueHeron@lemmy.ca 6 points 22 hours ago (1 children)

This is one of the things that frustrate me about Debian based systems. I know most distributions ship with lots of different tools to do the same job and you pick the one you like. But with something as fundamental as system timers it just feels wrong to me - when I want to change the timing of something I first need to figure out is the cron job real, or just a stub referring to the systemd timer, or visa versa.

So for a while I had removed cron from all my systems and fully committed to timers. Now I've decided I don't like systemd and gone fully the other way.

I know it's not that bad, but that's the way my brain works - and I can remember getting really screwed up with some early Ubuntu systems.

[–] 4am@lemmy.zip 3 points 20 hours ago

Yeah, it’s never fun having both a legacy and a new system at the same time

Same with sysv and systemd job files. That seems to be mostly cleaned up now but for a while it was a PITA.

I like the article but I dislike the headline. :)

[–] HiTekRedNek@lemmy.world 0 points 17 hours ago (3 children)

More and more, Linux is becoming Microsoft. "Oh, your system doesn't run systemd? Good luck using anything else loser!"

[–] Railcar8095@lemmy.world 9 points 12 hours ago (1 children)

Are you complaining that you need systemd to use systemd timers?

[–] mal3oon@lemmy.world 1 points 11 hours ago

Tbh, there are lots of variety in linux if you don't want systemd. Void in particular is really neat, been running it on one of my old 2017 xiaomi "air" notebook, i3 (back when lukesmith was a linux jesus). It's amazingly stable for a rolling release, and very light compared to my other arch systems.

[–] heartSagan5@lemmy.zip -2 points 11 hours ago

Because a lot of Microsoft employees contribute to Linux in their spare time to keep their skills sharp. It says something about a platform when you’re free to work on other platforms.

Also, Microsoft released Azure Linux.

[–] PlexSheep@infosec.pub -1 points 21 hours ago (1 children)
[–] corsicanguppy@lemmy.ca 2 points 13 hours ago

Never heard of it

It's something coded up by a Microsoft employee. Or did he take his toys and move on again?

[–] plc@feddit.dk -1 points 23 hours ago

The headline puns made my day❤️