MacOS – Schedule jobs with at or crontab on Mac OS X and some alternatives

macosschedule

Using the command line of Mac OS X system, are at and crontab the correct utilities to use to schedule jobs/processes/scripts? Especially my own scripts.sh?

I am aware that both at and crontab (actually I am not sure about crontab) comes installed by default with Mac OS X but I have this feeling that I need to use something else in order to have it work properly on a Mac OS X system. Of course I am aware of third party application/software/mdm etc. but I am interested with what comes installed by default inside the Mac OS X.

Best Answer

launchd

On macOS, launchd is Apple's replacement for cron. I don't know what the "official" replacement for at is.

See the StartCalendarInterval key in launchd.plist(5) to get started.