this post was submitted on 31 May 2026
115 points (90.2% liked)

Technology

85571 readers
3670 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
you are viewing a single comment's thread
view the rest of the comments
[–] A_norny_mousse@piefed.zip 20 points 2 weeks ago (8 children)

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

[–] nous@programming.dev 27 points 2 weeks ago (6 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.

[–] qupada@fedia.io 21 points 2 weeks 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 1 points 2 weeks ago

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

load more comments (4 replies)
load more comments (5 replies)