C.W.K.
Stream
Lesson 03 of 12 · published

rsync — Why It Wins

~15 min · rsync, delta-transfer, fundamentals

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

The killer feature: delta transfer

rsync compares source and destination at a block level and transfers only what differs. Change a 1 KB string in a 1 GB log file? rsync sends roughly 1 KB plus checksums — not 1 GB. This is the property that makes rsync the universal file-sync tool of the Unix world.

What you get on top of delta

  • Compression in flight (-z) for slow links.
  • Resume with --partial when transfers get cut.
  • Exclude patterns — skip node_modules, .git, etc.
  • Permissions, timestamps, symlinks, ownership preserved with archive mode (-a).
  • Dry run (-n) — see exactly what would change without running.
  • Sync deletion (--delete) — make the destination an exact mirror of the source.
  • Local or over SSH — same syntax for both.

Code

The classic invocation·bash
# Local-to-local sync
rsync source.txt destination.txt

# The standard daily command
rsync -avz --progress source/ dest/
# -a  archive mode (rlptgoD — preserves everything sane)
# -v  verbose
# -z  compress in transit
# --progress  per-file transfer bars

# Over SSH (same syntax with user@host)
rsync -avz --progress ./project/ office:/home/you_username/project/

External links

Exercise

Find a directory you've scp'd before. Run rsync -avz --progress ./that-dir/ host:/tmp/that-dir-rsync/ — note the time. Run it again with no changes — should finish in seconds (delta transfer found nothing to send). Modify one file in the source, run again — see only that file transfer.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.