File transfer methods

From campisano.org
Jump to navigation Jump to search

Rsync

rsync -a --append-verify --delete -c -z -v -h --progress --stats <HOSTS:REMOTE_SOURCE_PATH>/ <LOCAL_DESTINATION_PATH>/
# or
rsync -a --append-verify --delete -c -z -v -h --progress --stats <LOCAL_SOURCE_PATH>/ <HOSTS:REMOTE_DESTINATION_PATH>/

Options that you should use:

  • -a - implies -H -A -X
  • -H - preserve hard links
  • -A - preserve ACLs, implies -p
  • -p - preserve permissions
  • -X - preserve extended attributes
  • --append-verify - use --append with a checksum
  • --append - allows to continue a interrupted transfer, implies --inplace
  • --inplace - allow to continue a interrupted transfer in place, with no need to trnasfer the whole file, implies --partial
  • --partial - keep partial files to be used in a subsequent transfer

Optional options:

  • --delete - remove from DESTINATION files that does not exist in SOURCE
  • -c - use checksum to compare, instead of time and size (can be slower)
  • -z - compress data before transfer
  • -v - verbose
  • -h - human readable
  • --progress - show a progress
  • --stats - show statistics at end