If there is a “right” way from Apple’s point of view, then it’s launchd
. Not that cron
is “wrong” per se but it is not the “preferred” way.
However, as you indicated, launchd
can be a pain to work with.
There are two good apps to try:
https://www.soma-zone.com/LaunchControl/ ¹
https://www.peterborgapps.com/lingon/
Lingon has been around for a long time and is probably better known, but I switched to LaunchControl a few years ago and much prefer it.
The developer also maintains https://launchd.info which is a helpful tutorial website to understand how launchd
works.
LaunchControl also has a built-in tool that can mitigate issues around Full Disk Access, making it easier to deal with macOS' restrictions.
There is another, simpler option: Keyboard Maestro. Not only does Keyboard Maestro have a feature to run scripts (or macros, etc) at a specific time or recurring every X minutes, but you can also use cron-style syntax if you want.
Given that Keyboard Maestro is the best automation tool for the Mac, and I'd probably sacrifice a finger rather than be forced to use a Mac without it, you can guess that I strongly recommend Keyboard Maestro. It has a free trial (for other 2 weeks or 30 days, I'm not sure, but it's definitely a long time) and is actively maintained.
¹ As of this writing, both the LaunchControl website and launchd.info site appear to be down, which I assume is just a temporary glitch. They were working as recently as last night. If it is still down when you read this, you can download a copy of the latest version (which also has a free trial) from my website here:
https://iusethis.luo.ma/launchcontrol/LaunchControl-1.52.3.tbz2
launchd
and while it's a bit of a handful learning it from the various manual pages around it,launchctl
,launchd.plist
andlaunchd
, there are third-party applications that present a GUI interface to it. One of which that I've used in the past is Lingon, however there are a few more of them out there.launchd
jobs are subject to the same permissions restrictions ascron
jobs (see "How to run a LaunchAgent that runs a script which causes failures because of System Integrity Protection", for example). Personally, I don't see any great need to switch fromcron
, if that's what you're more comfortable with (at least at this point). But if you do need to switch,launchd
is definitely the system to switch to.