Mac Terminal icon

Mac Terminal icon

Some advanced Mac users may have noticed that certain shell scripts with cron, cron jobs, and crontab are either not working at all, or not able to function properly in the newest versions of MacOS, notably Mojave 10.14, Catalina 10.15, macOS Big Sur 11, and later. Depending on the situation, this may be accompanied by a permissions error, an operation not permitted error, or a script or cronjob may simply fail silently in the background. While there are numerous reasons a cronjob may fail, strict security measures in the latest MacOS releases may also be at fault and cause problems for some users.

This article will walk through resolving cron permissions issues with the latest versions of MacOS, including macOS Big Sur, Catalina, and Mojave.

Note this is aimed at advanced Mac users only. If you don’t use cron and have permission related issues with it, then you will not want to make any of these modifications.

How to Grant cron Full Disk Access in MacOS

If cron is having permissions issues in the latest versions of MacOS, you will need to grant cron full disk access on the Mac. Here’s how to do this:

  1. Open System Preferences from the  Apple menu, then choose “Security & Privacy”
  2. Go to the “Privacy” tab, then select “Full Disk Access” from the side menu options
  3. Click the lock icon in the corner and authenticate with an admin password to grant permission to modify Full Disk Access settings
  4. Now from the Finder in MacOS, pull down the “Go” menu and choose “Go To Folder”
  5. The cron path in MacOS

    The cron path in MacOS

  6. Enter the path: /usr/sbin/cron and choose Go
  7. Drag and drop “cron” into the list of apps and processes with Full Disk Access permission, ‘cron’ should now appear in the list
  8. Allow cron full disk access in MacOS

    Allow cron full disk access in MacOS

  9. Close out of System Preferences and the open Finder sbin window when finished

While you’re in the same settings section, you may also want to add the Terminal application to the Full Disk Access options to fix “Operation not permitted” Terminal error that can also be encountered by the new security measures in MacOS, and perhaps smbd too if you rely on it for networking.

Fixing cron permissions issues in MacOS

Fixing cron permissions issues in MacOS

As mentioned before, this is for advanced users only, and you should not grant apps, processes, or anything else Full Disk Access if you do not know exactly what you’re doing and why you’re doing it. Cron is able to run processes automatically with full root access in the background on a Mac, which has obvious legitimate uses as well as security implications, so if you aren’t specifically needing that ability then you should not adjust this setting.

You can always revoke Full Disk Access at any time in MacOS by returning to the settings and adjusting accordingly. Similarly, you can also adjust and control what apps can access files and folders on the Mac. These security features are best left alone by most users, but advanced users often tweak these settings to accommodate specific apps and activity on their computers.

Cron is quite powerful and it can be used for all sorts of automation, backups, scripting, and other advanced activity, you can always check crontab for scripts and change the default crontab editor if you’d like too.

Did this help resolve any cron issues you were experiencing on new versions of Mac OS? Do you have any particular tips or tricks for cron? Share your thoughts and experiences in the comments.

Source