Skip to content

Instantly share code, notes, and snippets.

@guyhughes
Last active December 30, 2016 04:24
Show Gist options
  • Save guyhughes/b1b53e803c5c9911900b to your computer and use it in GitHub Desktop.
Save guyhughes/b1b53e803c5c9911900b to your computer and use it in GitHub Desktop.
rsync

rsync as mv replacement

rsync -chavP --inplace --remove-source-files ./src ./dest

awesome rsync options

  • -c checksum
  • -h human sizes
  • -v verbose
  • -P shortform for --progress --partial

options for live remotes / backups

  • -u update -- skip files that are newer on remote

obscure options

  • --inplace copy from original src instead of making a copy of it then copying it
  • advantage: speeds up rsync ops, preserves hardlinks
  • disadvantage: src file I/O access restriction error possibility, delta transmission feature breaks
  • --remove-source-files deletes src files after copy
  • NB: doesn't remove dirs after copy, can remove with rmdir *, sigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment