Skip to content

Instantly share code, notes, and snippets.

@maheshgawali
Created January 2, 2019 06:24
Show Gist options
  • Save maheshgawali/57d690945fb966328b9727b923b075fb to your computer and use it in GitHub Desktop.
Save maheshgawali/57d690945fb966328b9727b923b075fb to your computer and use it in GitHub Desktop.
rsync cmd with flags for optimal data transfer
# Tested on ubuntu-18 and mac os x (mojave)
# I also tried the ssh compressed way of doing things, but this is much simpler
# There might be better combinations available, please leave a comment and I shall test and update this gist
rsync -vaHxPz username@IP:SOURCE_PATH DESTINATION_PATH
# rsync options explanation:
# -v, --verbose increase verbosity
# -a, --archive archive mode; same as -rlptgoD (no -H)
# --no-OPTION turn off an implied OPTION (e.g. --no-D)
# -H, --hard-links preserve hard links
# -x, --one-file-system don't cross filesystem boundaries
# -P same as --partial --progress
# -z, --compress compress file data during the transfer
# --compress-level=NUM explicitly set compression level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment