Skip to content

Instantly share code, notes, and snippets.

@ctreffs
Last active March 30, 2020 20:39
Show Gist options
  • Save ctreffs/41339a8ddbddfb36269702cf3ae287ae to your computer and use it in GitHub Desktop.
Save ctreffs/41339a8ddbddfb36269702cf3ae287ae to your computer and use it in GitHub Desktop.
Rsync with options
rsync --archive --compress --crtimes --executability --human-readable --info=progress2 --ipv6 --partial --prune-empty-dirs --safe-links --sparse --update <SRC> <DEST>
- or -
rsync -azNE6mSu --info=progress2 --partial --safe-links <SRC> <DEST>
@ctreffs
Copy link
Author

ctreffs commented Feb 20, 2020

  • -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
  • -z, --compress compress file data during the transfer
  • -N, --crtimes preserve create times (newness)
  • -E, --executability preserve executability
  • --info=progress2 outputs statistics based on the whole transfer, rather than individual files.
  • -6, --ipv6 prefer IPv6
  • --partial keep partially transferred files
  • -m, --prune-empty-dirs prune empty directory chains from file-list
  • --safe-links ignore symlinks that point outside the tree
  • -S, --sparse turn sequences of nulls into sparse blocks
  • -u, --update skip files that are newer on the receiver

Exclude files with:

  • --exclude '<your_pattern_>'

@ctreffs
Copy link
Author

ctreffs commented Mar 30, 2020

rsync -abviuzP <SRC> <DEST>

  • -b, --backup make backups (see --suffix & --backup-dir) --backup-dir=DIR make backups into hierarchy based in DIR --suffix=SUFFIX set backup suffix (default ~ w/o --backup-dir)
  • -i, --itemize-changes output a change-summary for all updates
  • -u, --update skip files that are newer on the receiver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment