Privacy Policy
Snippets index

  Remote copy of files that need root access with rsync

rsync -a --rsync-path="sudo -u OWNER rsync"  SOURCE  DESTINATION

given that:

--rsync-path=PROGRAM    specify the rsync to run on remote machine

Examples:

rsync -a --rsync-path="sudo -u www-data rsync" path_to_local_data/ login@srv01.example.com:/var/www
rsync -a --rsync-path="sudo rsync" path_to_local_data/ login@srv01.example.com:/var/www