Hacker News new | ask | show | jobs
by Spivak 2560 days ago
Things you get with systemd that you don't get with cron unless you implement them in the script.

* Not running if the network is down.

* Not running if the download path isn't available.

* Running if the machine was off during the scheduled time.

* Monitoring and retry logic.

* Logging to syslog.

* Resource constraints.

* Random wait.

It ends up being a lot of code factored out of the actual application.

1 comments

so instead of code in one place you have it in 2?
I don’t understand this logic. Can you explain why having code in more than one place is a bad thing?
For a simple script that does one thing, it's overkill.
Yes. So you keep that simple script simple, and you let systemd do the heavy lifting.
But systemd doesn't do any of the above listed things automatically... You'd need to write an entire script for sytstemd to take advantage of it. An entire script you could just have run with cron on boot.