Ask Different Asked by Vaelin on December 15, 2021
I am trying to sync a local directory to my NAS that is mounted via the afp protocol as a drive. I am using rsync. When I run the command from the terminal, it works fine. However, when I try to run it from launchd, it always fails.
This is my rsync command:
rsync -av --delete /Users/self/Pictures/ /Volumes/nas/Images
This is the plist
file that contains the above command. It is located in ~/Library/LaunchAgents
with user, groups, and permissions equal to the other (working) plists in that directory.
<?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>rsync_picture_to_nas</string>
<key>ProgramArguments</key>
<array>
<string>rsync</string>
<string>-av</string>
<string>--delete</string>
<string>/Users/self/Pictures/</string>
<string>/Volumes/nas/Images</string>
</array>
<key>StandardErrorPath</key>
<string>/Users/self/.log/rsync_picture_to_nas_err.log</string>
<key>StandardOutPath</key>
<string>/Users/self/.log/rsync_picture_to_nas_out.log</string>
<key>WatchPaths</key>
<array>
<string>/Users/self/Pictures</string>
</array>
</dict>
</plist>
It always has complete permissions failure. The exact permissions errors will depend on whether I am running it from scratch or have previously run it successfully from the command line. Suffice to say, it is totally incapable of doing anything. It can’t create or modify any files on the NAS at all.
Here is a sample error:
rsync: recv_generator: mkdir "/Volumes/nas/Images/Lightroom Library.lrlibrary" failed: Operation not permitted (1)
*** Skipping everything below this failed directory ***
I figured out the problem. It is Apple's new permissions system. I had to give rsync full disk access under System Preferences > Security and Privacy > Full Disk Access > +
. If you can't find rsync, crack open a terminal and do which rsync
. It is probably at /usr/bin/rsync
.
Answered by Vaelin on December 15, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP