Skip to content

Instantly share code, notes, and snippets.

@mowings
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mowings/7231988a2fd6ee7089d0 to your computer and use it in GitHub Desktop.
Save mowings/7231988a2fd6ee7089d0 to your computer and use it in GitHub Desktop.
rsync as sudo-ed user on the remote host. Needed to preserve permissions, get special files over, etc
# Remote user must have NOPASSWD set in sudoers
# This example mirrors an entire directory
rsync --progress -avz --delete --rsync-path="sudo rsync" /path/to/sync/ user@host:/path/to/sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment