Rsync with Sudo on Remote Systems
By default, rsync connects as your standard user. When you need to write to protected directories like /etc, /var/www, or other root-owned locations, use the –rsync-path option to invoke rsync with sudo privileges on the remote side. Basic syntax rsync -avz –rsync-path=”sudo rsync” local-file user@remote:/protected/path This tells the remote server to execute rsync under sudo….
