rsync Cheat Sheet

Efficient delta-based sync — mirrors, backups, and large transfers with bandwidth limits and progress.

Networking3 sections · 17 commands
⌘K

Sync Basics

6
rsync -av SRC DEST

Archive mode + verbose

rsync -av SRC/ DEST/

Trailing slashes = contents of dir

rsync -avzh SRC DEST

Add human-readable + compress

rsync -av --progress SRC DEST

Per-file progress bar

rsync -n -av SRC DEST

Dry run (no changes)

rsync -av --delete SRC/ DEST/

Mirror exact (deletes extra files)

Over SSH

5
rsync -avz SRC/ user@host:/dest/

Sync to a remote host

rsync -avz user@host:/src/ ./

Sync from a remote host

rsync -e 'ssh -p 2222' SRC user@host:

Custom SSH port

rsync -e 'ssh -i KEY.pem' SRC user@host:

Specific key

rsync -avz --bwlimit=2000 SRC user@host:

Cap speed to 2 MB/s

Backups & Options

6
rsync -a --partial --info=progress2 /data /backup

Resumable large copy

rsync -a --exclude='*.log' --exclude='cache/' SRC/ DEST/

Skip files/patterns

rsync -a --backup --backup-dir=/backup/old SRC/ DEST/

Keep replaced versions

rsync -a --link-dest=PREV SRC/ DEST/

Hardlink-based snapshots

rsync -az --del --stats /app/ deploy@server:/app/

Deploy with stats

rsync -av --checksum SRC DEST

Checksum every file (slower, exact)