rsync Cheatsheet - File Sync

rsync's strength is transferring only the changed parts; with --delete it mirrors the destination to match the source, making it standard for log backups and site deploys. This table breaks down common flags and especially stresses running --dry-run (and --checksum to see differences) before the real sync to avoid accidental deletions.

SysOps·31 commands·Last updated 2026-07-19
rsyncSyncBackupFile Transfer

Basic Sync 4

rsync -avz ./src /dest
Sync src directory to dest (including src itself)
rsync -avz ./src/ /dest
Sync src contents to dest (not src itself)
rsync -avz user@host:/remote /local
Pull from remote to local
rsync -avz /local user@host:/remote
Push from local to remote

Transfer Options 5

-z, --compress
Compress data during transfer
-n, --dry-run
Simulate, no actual transfer
--partial
Keep partially transferred files (resume)
--bwlimit=1M
Limit bandwidth to 1MB/s
-e ssh
Use SSH as the transport

Display Options 6

-v, --verbose
Verbose output
-q, --quiet
Quiet mode
--stats
Show transfer statistics
-h, --human-readable
Human-readable numbers
--progress
Show progress
-P
Same as --partial --progress

Skip & Filter 5

-u, --update
Skip files newer on the target
-c, --checksum
Skip by checksum (not time+size)
--exclude=.git
Exclude the .git directory
--exclude-from=.rsyncignore
Read exclude rules from a file
--include=*.txt
Include specific files

Backup Options 4

-b, --backup
Back up overwritten files
--suffix=.bak
Backup file suffix
--backup-dir=/backup
Back up to a given directory
--delete
Delete extra target files (mirror)

Archive Mode 7

-a, --archive
Archive mode (-rlptgoD)
-r, --recursive
Recurse into directories
-l, --links
Preserve symlinks
-p, --perms
Preserve permissions
-t, --times
Preserve modification times
-g, --group
Preserve group
-o, --owner
Preserve owner

Tips

  • src/ syncs contents, src syncs the directory itself.
  • -a is shorthand for -rlptgoD, preserving nearly all attributes.
  • --delete removes extra target files; add -n to simulate first.
  • rsync is incremental — only deltas are sent, very efficient.
  • Remote transfer uses SSH by default; -e overrides the command.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 19, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us