Tutorial

Crontab on Mac.

macOS still ships cron, and crontab -e works the same as on Linux. A few Mac-specific things trip people up: the default editor is vi, cron can't see Homebrew, privacy protection blocks some folders, and missed jobs don't run after sleep.

Add a cron job on a Mac

crontab -e

This opens your crontab in vi (cron's built-in default when VISUAL and EDITOR aren't set). Press i to type, then Esc and :wq to save. To use another editor, set it for that one command:

EDITOR=nano crontab -e

More on editors, root's crontab and removing jobs in how to edit a crontab.

Add a line, for example every day at 9 AM:

0 9 * * * /Users/alice/jobs/report.sh >> /Users/alice/jobs/report.log 2>&1

Save and quit, and crontab installs it. Check with crontab -l. You don't need to start anything: launchd starts cron automatically as soon as a crontab exists.

Where Mac crontabs are stored

Per-user crontabs live in /usr/lib/cron/tabs/<username>, and the system crontab is /etc/crontab. Apple's launchd job com.vix.cron watches both locations and launches /usr/sbin/cron when either has content. Always edit through crontab -e rather than editing the files directly.

"command not found": cron can't see Homebrew

Cron runs jobs with PATH=/usr/bin:/bin. Your Terminal's PATH from ~/.zshrc doesn't apply, so tools installed by Homebrew (in /opt/homebrew/bin on Apple silicon) or in /usr/local/bin aren't found. Fix it one of two ways:

# 1. Use full paths in the job
0 9 * * * /opt/homebrew/bin/python3 /Users/alice/jobs/report.py

# 2. Or set PATH at the top of the crontab
PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
0 9 * * * python3 /Users/alice/jobs/report.py

Find a tool's full path with which python3 in Terminal. Jobs run with /bin/sh, not zsh, so zsh-only syntax won't work in the crontab line.

"Operation not permitted"

macOS privacy protection stops cron from reading or writing Desktop, Documents, Downloads, iCloud Drive and network volumes. The fix (Full Disk Access for /usr/sbin/cron, or moving the files) is on its own page: macOS crontab "Operation not permitted".

Jobs missed while the Mac sleeps don't run

If the Mac is asleep or off at the scheduled time, cron skips that run and waits for the next one. Apple's own scheduler, launchd, behaves differently: a StartCalendarInterval job that was due while the Mac slept runs when it wakes. Apple describes cron as deprecated on macOS and recommends launchd for timed jobs, so for anything on a laptop, launchd is the better choice. There's a ready-to-use launchd example on the Operation not permitted page.

Common Mac schedules

ScheduleMeaning
*/15 * * * *Every 15 minutes
0 9 * * 1-59 AM on weekdays
30 18 * * 56:30 PM every Friday
0 0 1 * *Midnight on the 1st of the month

Check any schedule in the cron translator. To remove all your jobs: crontab -r (it doesn't ask first).

Sources

Checked against these official manuals and source code. Last verified 18 November 2026.