Use launchd instead of crontab on your Mac

As of Mac OS 10.4 crontab has been depreciated but not ended. So its a good idea to know how to use its replacement under Mac OS. Welcome to Launchd.

This will be a short guide on how to use launchd in a simple form to replace a crontab job. In my case I am automating the backup of my Plex server. You can see my previous article here

Launchd has a lot of other features. I will not look at them here.

You can checkout these other resources:

A basic example of a plist file for launchd. In this case we will use plexback.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
<plist version="1.0">

Note: Replace ACCOUNT with your login username.

You will need to create this file under your ~/Library/LaunchAgents/

If your system is always running and never shuts down. You will need to issue the command:
launchctl load -w ~/Library/LaunchAgents/plexback.plist
This will register your task with the scheduler that is used with launchd.

See also