MacOS – cron lacks permissions to run a script

bashcronmacospermission

I have a script (which backs up, using rclone) that I can run from the Terminal or Automator after chmod a+x, with no permissions problems.

However, when this script is run in cron (or launchd), stderr shows "/bin/bash: /Users/joshua/script.sh: Operation not permitted."

I am more familiar with Ubuntu, where this approach works fine.

What do I need to do here?

Edit: The above question remains relevant, but note that launchd is the favored cron replacement for Mac, while Automator is available for application-level scheduling.

Best Answer

It looks like the proper two programs to give full access to are:

cron
terminal.app

See rsync in cron on Catalina no longer working