One of the latest OS upgrades caused a script loaded by launchctl to fail for permissions.
my script does this to mirror a mounted path into my disk:
rsync -av --delete <mounted-path> <local-path>
I have no problem in running it manually, but running from the daemon I'm getting:
building file list ... rsync: opendir "<mounted-path>." failed: Operation not permitted (1)
I'm quite sure that I need to provide permission to the script, but couldn't find a way to grant the permission from System Prefs -> Security & Privacy -> Privacy -> Files and Folders. The [+/-] there is grayed off...
Any idea please?
EDIT: more data:
My plist: (com.mycompany.update-folder-from-nfs.plist)
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.mycompany.update-folder-from-nfs</string> <key>ProgramArguments</key> <array> <string>/Users/myname/Prog/something/uz-cpu/update_from_nfs_using_rsync.sh</string> </array> <key>StartInterval</key> <integer>45</integer> </dict> </plist>
Loading the plist:
launchctl unload ~/Library/LaunchAgents/com.mycompany.update-folder-from-nfs.plist || echo "ok" cp com.mycompany.update-folder-from-nfs.plist ~/Library/LaunchAgents/ launchctl load ~/Library/LaunchAgents/com.mycompany.update-folder-from-nfs.plist