Linux provides three different job schedulers i.e. Cron, Anacron and Systemd-Timer. What are the benefits of Cron/Anacron vs. Systemd-Timer?
Ubuntu – Cron/Anacron vs. Systemd
anacroncronschedulersystemd
anacroncronschedulersystemd
Linux provides three different job schedulers i.e. Cron, Anacron and Systemd-Timer. What are the benefits of Cron/Anacron vs. Systemd-Timer?
Best Answer
In favor of Cron
In favor of systemd
systemd
captures STDOUT and STDERR of your job and stores it in the systemd journal.systemctl status your-service
to check the status of what you ran. Outside of combing logs, cron offers no structured way to query the service status.systemctl list-timers
to get a summary of enabled timers and see when they last ran and when they will next run.In summary
Systemd timers have some overhead to learn and setup, but provide a number of benefits. There some packages like
systemd-cron
andsystemd-cron-next
that allow you to havecron
entries converted tosystemd-timers
, to try to provide a best-of-both-worlds solution