Is cron Obsolete?
I learned about cron early in my Linux education. It’s an amazing tool for scheduling programs to run at specific repeating instances in time. It has some simple methods that can be used to run programs on an hourly or daily basis. I won’t go into all those details because you can read about cron in my article, “How I use cron in Linux.”
A few years ago, I also learned about the systemd timers that are also used to trigger programs to run at specified times. There’s no need to go into the details of using systemd timers here either, as you can read my article, systemd — #7: Use systemd timers instead of cronjobs.
I suggest you read these articles if you’re not familiar with these important and powerful tools.
But what I want to explore here is the question of whether cron is obsolete. systemd timers can do almost everything cron can do and more. One of the things timers can do that cron can’t, is to trigger a program at a specific amount of time after the system has booted. Another is to trigger an event at a specific amount of time after the time was started, which might not be the same time as Linux startup.
The cron tool has some capabilities that systemd timers don’t. The two that I use are the ability to simply drop a script into /etc/cron.daily and have it run once daily or cron.hourly to have it run once an hour. There are also directories for monthly and weekly. Another tool is anacron which ensures that scripts located in /etc/cron.daily, weekly, and monthly are run even if the computer has not been on and running 24 hours a day.
There is a great deal of overlap in the functions of timers and cron. There are also some things that each can do that the other can’t. And no amount of research revealed any plan to make cron obsolete. In many past planned obsolescences, the man page would indicate that the program was obsolete and refer the reader to its replacement.
So, no, cron is not obsolete. systemd timers and cron complement each other as each can do some things that the other can’t.