I'm trying to do an rsync between two machines over SSH (Source: macOS 10.11.6 -> Dest: macOS 10.12.4) and want to keep all mac specific attributes as well as permissions and ownership.
I have built and installed the lastest rsync (3.1.2) from source on both machines using the patches, fileflags, crtimes and hfs-compression.
I have modified /etc/sudoers on the destination machine and added: username ALL = (ALL) NOPASSWD: ALL and this seems to working fine as I'm not asked for password when using sudo. (I know I can limit this to only the rsync command but during debugging I'm using ALL here)
Executing:
rsync -avNHAXEx --safe-links --fileflags --protect-decmpfs --force-change -- progress --delete --rsync-path="sudo /usr/local/bin/rsync" --progress /path/to/src ssh_user@IP_of_dest:/path/to/dst
results in a correct sync aside from that the files have Posix owner 'ssh_user' instead of original owner on the destination machine.
A simple
rsync -av --rsync-path="sudo /usr/local/bin/rsync" /path/to/src ssh_user@IP_of_dest:/path/to/dst
also modifies the ownership and rsync pull executed with sudo on the destination machine gives the same result.
So, what am I missing here? Shouldn't -a and super rights on destination be enough?