How to run a LaunchAgent that runs a script which causes failures because of System Integrity Protection After upgrading to Mojave, my rsync based backup script run via a launch agent in ~/Library/LaunchAgents, could no longer read some directories in ~/Library.
I solved this as follows as follows:

Allow Bash to have Full Disk Access


Open Preferences
Go to Security &amp; Preferences
Select Full Disk Access in the list on the left
Click the lock to make changes
Click the + button on the list on the right
Navigate to the root of your HD
Press CMD+Shift+. to show all the hidden items
Select /bin/bash
Quit Preferences
Restart the mac (I am not sure if this is really necessary)


Run your script correctly

The mistake I made was that the launch agent ran the script like this:

&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;/Users/channing/bin/backup.sh&lt;/string&gt;
&lt;/array&gt;


Do this instead

&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;/bin/bash&lt;/string&gt;
    &lt;string&gt;/Users/channing/bin/backup.sh&lt;/string&gt;
&lt;/array&gt;


Restart your agent:

launchctl unload ~/Library/LaunchAgents/backup.plist
launchctl load ~/Library/LaunchAgents/backup.plist


Rejoice.