Quiz Entry - updated: 2026.07.14
What does rsync -a (archive mode) actually preserve, and why does the trailing slash matter?
-a is a bundle of preservation flags (recursive + symlinks + permissions + times + owner/group + devices) — it makes the copy a faithful replica rather than just file contents.
A plain copy moves bytes but loses everything around them. Archive mode (-a) turns on the set of flags that keep a directory tree truly identical:
| Flag | Preserves |
|---|---|
-r |
Recursion into subdirectories |
-l |
Symlinks copied as symlinks (not their targets) |
-p |
Permissions |
-t |
Modification times |
-g / -o |
Group / owner (owner needs root) |
-D |
Device and special files |
So -a = "copy this tree so it looks exactly like the original." Common combos:
rsync -av src/ dest/ # archive + verbose
rsync -avz src/ remote:/path/ # + compress data in transit
rsync -av --delete src/ dest/ # true mirror: also remove files gone from src
The trailing-slash gotcha decides what gets copied:
rsync -av dir/ dest/→ copies the contents ofdirintodest.rsync -av dir dest/→ copiesdiritself intodest(you getdest/dir/).
That one slash is the most common rsync surprise — and combined with --delete it can wipe the wrong target, so always double-check it before mirroring.
Go deeper:
rsync man page —
-a=-rlptgoD, plus source trailing-slash behaviour and--delete.