by skwee357 on 3/10/25, 9:04 PM with 78 comments
by tombert on 3/14/25, 2:13 AM
They are, in all ways that I care about, simply better than cron, and especially in NixOS they're really easy to set up.
by timrichard on 3/14/25, 2:16 AM
For example, show the next five trigger times for the end of the last day when the month has 31 days :
systemd-analyze calendar --iterations=5 '*-*-31 23:59:59'
by notepad0x90 on 3/14/25, 3:16 AM
by merpkz on 3/14/25, 7:25 AM
EDIT: yea, the email reporting is certainly missing, but it was hard to control it since whole STDOUT was shipped, which is not what I wanted most of the time anyways. It would be good to come up with some way to still have small overview emails sent about important jobs done, maybe a dependency service which starts when important job finished and just sends an email about that
by kinglawrence on 3/14/25, 3:59 AM
by MantisShrimp90 on 3/14/25, 1:39 AM
by akeck on 3/14/25, 4:19 AM
by bhaney on 3/14/25, 2:52 AM
> If you want to execute pre/post commands you have to do it inside the script itself
So?
> There are no built-in logs
Every cron implementation I can remember using logs each run to syslog and emails me the output of the run by default
> There is no built-in status monitoring
I can't think of any built-in status monitoring that systemd has for timers that's materially different from cron's logging/emailing
> If the system is down when the cron needs to run, the cron will be missed
Some cron implementations support this and some don't. Most modern ones that I'm aware of do.
Much more significantly, the amount of setup involved in a systemd timer is way higher than putting a line in a crontab, especially for the author's case of just running a backup script.
Cron only involves running `crontab -e` and adding the line "@daily /path/to/script.sh" (which also handles the author's issue of cron "skipping" runs if the system was powered off, assuming the cron implementation uses something modern like anacron)
Systemd involves writing a 7 line timer unit file, an additional 5 line service file, running a daemon-reload, then enabling the timer. It turns what's usually a 10 second mindless task into a much more involved procedure. That can be worth it if there are material benefits from it, but I'm not really seeing them here.
by rs_rs_rs_rs_rs on 3/14/25, 5:48 AM
by dmd on 3/14/25, 4:41 PM
by burnJS on 3/14/25, 2:59 AM