I'm getting errors running rsync between two Macs: the client is Big Sur with Homebrew rsync (the stock rsync has the same behaviour) and the remote machine is running Monterey. I'm getting errors such as failure to rename, delete and set times. It might be a sandbox error. What's the correct way to configure this setup on the remote machine?
Typical command:
rsync -ra --progress --copy-links --delete Desktop/ mac2.local:/Users/myuser/Desktop/from-mac1/Desktop/
Typical errors on the client side (the rename error is when I used -P (--partial):
rsync: opendir "/Users/myuser/Desktop/from-mac1/Desktop/." failed: Operation not permitted (1)rsync: failed to set times on "/Users/myuser/Desktop/from-mac1/Desktop/subfolder": Operation not permitted (1)rsync: rename "/Users/myuser/Desktop/from-mac1/Desktop/subfolder/file.A7IqZh" -> "/Users/myuser/Desktop/from-mac1/Desktop/subfolder/file": Operation not permitted (1)rsync: failed to open "/Users/myuser/Desktop/from-mac1/Desktop/subfolder/file", continuing: Operation not permitted (1)
In the Console, I see messages from kernel (sandbox) like:
1 duplicate report for System Policy: rsync(6260) deny(1) file-write-times /Users/myuser/Desktop/from-mac1/Desktop/subfolder
I've tried to work-around possible sandbox issues by giving Full Disk Access to /usr/bin/rsync, /usr/bin/ssh, /usr/sbin/sshd and /bin/sh, but to no avail. Terminal.app already has these permissions, but I don't think that's relavent here.
I have the same user name and password on both machines, and UID and GUID also appear to be the same on both.
I've tried explicitly running over ssh:
rsync -e "ssh" --rsync-path="/usr/bin/rsync" -ra --progress --copy-links --delete Desktop/ mac2.local:/Users/myuser/Desktop/from-mac1/Desktop/
I've tried using a newer version of rsync from Homebrew on both sides of the connection (using the ssh invocation), but as this doesn't appear to be a signed binary, I'd prefer to focus on getting the stock version working first.
Additionally, it's not working copying from the remote system:
$ /usr/bin/rsync -ra --progress --copy-links mac2.local:/Users/myuser/Desktop/myfile.txt .
Password:
receiving file list ...
1 file to consider
rsync: send_files failed to open "/Users/myuser/Desktop/myfile.txt": Operation not permitted (1)
sent 42 bytes received 233 bytes 61.11 bytes/sec
total size is 50997886 speedup is 185446.86
rsync error: some files could not be transferred (code 23) at /System/Volumes/Data/SWE/macOS/BuildRoots/37599d3d49/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(1404) [generator=2.6.9]
Again, there's a message in the remote machine's Console from the kernel (sandbox):
System Policy: rsync(6393) deny(1) file-read-data /Users/myuser/Desktop/myfile.txt