Skip to content

Instantly share code, notes, and snippets.

@rot26
Last active April 29, 2019 21:02
Show Gist options
  • Save rot26/21c1d43bf3230ab873c2fb42fce3ac67 to your computer and use it in GitHub Desktop.
Save rot26/21c1d43bf3230ab873c2fb42fce3ac67 to your computer and use it in GitHub Desktop.
[rsync as root example] #rsync #sudo #root #scp #ssh
#rysnc as root by using `--rsync-path`
SOURCE_DIR="host-in-config:/path/to/copy"
DEST_DIR="/path/to/destination"
rsync \
--recursive \
--update \
--links
--rsync-path="sudo rsync" \
-e ssh \
--progress \
"${SOURCE_DIR}" \
"${DEST_DIR}" \
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment