LOGBOOK

HELP

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 of dir into dest.
  • rsync -av dir dest/ → copies dir itself into dest (you get dest/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:

  • doc rsync man page-a = -rlptgoD, plus source trailing-slash behaviour and --delete.

From Quiz: LIOS / Archiving and Software Packages | Updated: Jul 14, 2026