Cron tools › Convert
Cron to launchd
Move a cron job to macOS launchd. Paste the schedule and get a complete LaunchAgent property list with the StartCalendarInterval dictionaries spelled out, plus the commands to load it. The plist is parsed back as XML and its dictionaries are expanded into run times, which must match the cron line's.
Try one
How to run a cron job with launchd
- Paste the five schedule fields and choose a reverse-DNS label such as
com.yourname.backup. - Enter the command. Anything with spaces or shell syntax is run through
/bin/sh -cfor you. - Download the plist into
~/Library/LaunchAgents/under the label's name. - Check it with
plutil -lint, then load it withlaunchctl bootstrap gui/$(id -u) …. - Remove the crontab line so the job does not run twice.
How cron fields map to launchd keys
| Cron field | launchd key | Values |
|---|---|---|
| minute | Minute | one integer; missing = every minute |
| hour | Hour | one integer; missing = every hour |
| day of month | Day | one integer |
| month | Month | one integer |
| day of week | Weekday | one integer; 0 and 7 are both Sunday |
Each key holds a single number, so a list or range becomes an array of dictionaries — one per combination.
0 9,17 * * 1-5 is 2 hours × 5 weekdays = 10 dictionaries, and */15 9-17 * * 1-5 is 4 × 9 × 5 = 180.
The page warns above 100 and refuses past 3,000. A key you leave out is a wildcard, which is why * 9 * * * needs only
Hour = 9: without a Minute key it fires every minute of that hour.
Day of month and day of week together
When a dictionary has both Day and Weekday, launchd runs on either — the same OR rule as Linux cron, so
0 0 1 * 1 (the 1st, and every Monday) converts directly. The exception is cron's AND case: a day field that starts
with *, as in 0 0 */2 * 1, means "odd dates that are Mondays". launchd cannot AND the two keys, so the
plist lists the days of the month explicitly and the command checks the weekday with date +%u before running.
FAQ
What happens if my Mac is asleep at the scheduled time?
launchd runs the job when the Mac wakes. If several scheduled times were missed while it slept, they are combined into one run.
Why are there so many dictionaries?
Because StartCalendarInterval keys take one integer each. Every combination of the listed minutes, hours, days, weekdays and months has to be written out. For a plain "every N minutes" launchd has StartInterval, but it is not aligned to clock times, so this page does not use it.
Is Sunday 0 or 7?
Both work in launchd, as in Linux cron. The plist uses 0.
launchctl load or bootstrap?
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/label.plist loads a per-user agent on current macOS;
launchctl load is the older form. The page prints both.