is crontab broken on OSX El Capitan?
For Mojave, Full Disk Access prevents you from changing system files (which includes privacy related data as well as system configuration like the crontabs).
To enable access:
- Go to System Preferences > Security & Privacy > Privacy > Full Disk Access
- press the + button
- Add your terminal app (eg /Applications/Utilities/Terminal.app or /Applications/iTerm.app)
- Restart your terminal app
- Configure cron
- Optional, but highly recommended: Remove your terminal app from Full Disk Access when done
It seems to work for me, but I think you need to specify the editor:
env EDITOR=nano crontab -e
Add your crons, and then save the file with the name and location given. In my case it's a file in /tmp/crontab.xxxx
.
Then if you do crontab -l
you should see your crons.
On a MacBook, using El Capitan (10.11.5), "cron" still works just fine.
"/usr/lib/cron.deny" is the default (lists "Guest" only), and there is no "cron.allow". Don't recall doing any customisations to make it work (no init/config files mods, no chmod's, no file/dir creates/deletes, etc.).
(Was using 10.6.* until that MacBook died in April. Began using 10.11 in mid-May, restored my crontab after the 10.11.5 update (?late May?). So don't know if cron was working under 10.11, or re-enabled by the 10.11.5 update.)
Try this simple test: "crontab -e", then "*/5 * * * * date >> /tmp/z.date". Should see a new date every five minutes.
If that works, try "*/5 * * * * env >> /tmp/z.date.1", and check your environment. E.g., the default PATH is quite short.
Btw, "at" is a batch job queue. "at", "batch", and "cron" are often grouped together, as they do variations of the same thing.
This is another answer for anyone that finds this via Google. There aren't many results.
For me, somehow /usr/lib/cron
was symlinked to /var/at
(which I'd never even heard of…), and /var/at
had a cron.allow
file, which my username wasn't in, so running sudo vi /var/at/cron.allow
and adding my username (somehow redirecting echo
into that file didn't work…) fixed it.