Schedule things with cronjobs on macOS

Anybody who has even a little bit of Unix knowledge knows the many tricks of the trade that this OS offers. One of this is crontab:

The crontab utility is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron.  Each user can have their own crontab, and they are not intended to be edited directly.

And a cron, just to be clear, is a daemon thats execute scheduled commands.

The man pages also tell us:

The cron utility is launched by launchd(8) when it sees the existence of /etc/crontab or files in /usr/lib/cron/tabs.  There should be no need to start it manually.

Practically speaking, we can schedule things with cronjobs on macOS just by creating the right files that the cron daemon then executes. But cron files have a special syntax, that can be easily forgotten if you don’t use it everyday. The solution?

Use a GUI app!

I found this simple yet useful app, crontab-ui by , which can be installed through npm (if you’re not a javascript developer, just check it out, it’s really easy to install!) and gives us a neat interface to add, edit and remove cronjobs.

crontab-ui gif

Once installed, it will run a server on localhost port 8000, and by accessing that server with your browser you can manage all of your jobs from one place. You can also add a little syntactic sugar on top of you schedules by using the osascript command to add notifications.

Here’s an example:

It’s that simple.

Now let’s start scheduling things, may it be watering your plants with a raspberry pi or simply taking a daily picture with your webcam!

Lascia una risposta

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *


È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">