Alternative to Cron

For Linux systems what is a good alternative to cron?

ANSWER

(1) systemd

A lot of Linux distros are already using systemd. I’d say the major ones have been on systemd for a long time. It is capable of scheduling tasks just like cron, and has other features such as setting CPU/memory limit, randomized schedules to name a few. I haven’t used it yet. But I’ve seen some and creating a task is very different from what you may be used to with your traditional cron. It’s verbose. The good thing is there’s a lot of examples and documentation about it, plus it is built-in to your Linux system already.

(2) jobber

There’s an alternative to cron that I like to use called jobber. You can find it here: https://dshearer.github.io/jobber/

Quoting from the jobber website:

Jobber is a utility for Unix-like systems that can run arbitrary commands, or “jobs”, according to a schedule. It is meant to be a better alternative to the classic Unix utility cron

I’ve used jobber several times in little projects and some even in production. It is pretty robust and stable. As with anything new, using it requires some reading. The time format to schedule a task, or job, in jobber is not at all different from cron. It has other features such as error handling and reporting, as well as execution history.

jobber tasks are defined in a YAML file. That file can be placed in a user’s home directory. It’s not so hard to create a task for jobber. Their site has a good documentation found here: https://dshearer.github.io/jobber/doc/v1.4/#

There are pre-packaged binaries officially available to download for Debian/Ubuntu, and Red Hat. Or check your Linux distro’s application repository if it’s there. If not you could always compile it yourself. The last time I used this tool I also compiled it on the server. Easy to do that, and is explained also at their website.

Leave a Reply

Your email address will not be published. Required fields are marked *