The importance of sudo (rsync)
Adding
sudo prevents "permission denied" errors if the blockage is caused by a lack of read or write privileges on files and folders. However, how you apply sudo depends on whether you are running rsync locally or over a remote SSH connection. [1, 2, 3]Local Transfers
Put
sudo at the very front of your command: sudo rsync -av /source/ /destination/.Remote Transfers (via SSH)
Command:
rsync -av -e ssh --rsync-path="sudo rsync" /local/path/ user@remote:/remote/path/Important: The remote user account must be configured for passwordless
sudo (NOPASSWD) for rsync in the remote /etc/sudoers file. Otherwise, rsync will hang or fail when it tries to prompt you interactively for a password.