Dissecting the most frequently used flags in one episode: -a (archive), -v (verbose), -h (human-readable), -z (compression), -P (--partial and --progress), --delete for mirroring, and -n (dry-run) as a safeguard before execution.

So far you've run rsync -avh without really knowing what happens behind each letter. Episode 5 changes that: we dissect one by one the essential flags that will accompany almost every rsync command you write. Mastering the flags means mastering the rsync language — and avoiding surprises like changed permission modes or silently deleted files.
-a is the most important flag. It isn't a single behavior, but a combination of several flags at once:
-a = -rlptgoD| Letter | Meaning |
|---|---|
r | Recursive — descend into all subdirectories |
l | Symlinks — keep them as symlinks, don't copy their targets |
p | Permissions — preserve file permissions |
t | Times — preserve mtime (the basis of delta-transfer) |
g | Group — preserve group ownership |
o | Owner — preserve the owner |
D | Devices & special files — preserve devices and special files |
With -a, your backup becomes a high-fidelity mirror: files at the destination will have the same permissions, owners, timestamps, and symlinks as the source. That's why -a is called archive mode — it produces a faithful archive copy.
Note
-a doesn't include ACLs (-A), extended attributes (-X), or hardlinks (-H). We add those three in episode 15. A habit on migration servers: rsync -avHAX — the complete combination for maximum fidelity.
-v (verbose) — shows the list of files being transferred. Add more -v (-vv, -vvv) for deeper debug. In production, -v helps you monitor what's actually being done; without -v, rsync is almost silent.-h (human-readable) — displays sizes in an easy-to-read format (KB, MB, GB) in the summary output, instead of raw bytes.rsync -avh src/ dest/The summary output — sent, received, speedup — is only comfortable to read with -h active.
-z compresses data during transfer:
rsync -avhz src/ dest/-z pays off most on slow or distant networks (WAN, VPN, cross-continent) because it reduces the bytes crossing the connection. Conversely, on fast local networks or disk-to-disk, compression only adds CPU load and can slow things down — and already-compressed files (video, zip, images) can't be compressed further. We'll measure the impact quantitatively in episode 12.
-P is shorthand for two flags at once:
--partial — keep a file whose transfer was interrupted as a partial file, so it can be resumed, instead of discarding it.--progress — show real-time progress: percentage, speed, and estimated time to completion.rsync -avhP src/ dest/The -P combination is invaluable for large files (database dumps, images): if the connection drops at 60%, rsync keeps the 60% already done and resumes from there on the next attempt instead of starting from zero. Partial mechanism details are in episode 7.
--delete makes the destination identical to the source by deleting extra files at the destination:
rsync -avh --delete src/ dest/Its purpose: keeping a mirror from accumulating files that were already deleted at the source. Without --delete, the destination only grows, never shrinks — over time the backup accumulates garbage that "no longer exists" at the source.
Warning
--delete is a double-edged sword. A classic mistake example: rsync -avh --delete dest/ src/ (reversed direction) will wipe src's contents because it's "mirroring" from dest. Always test with -n first, and never put --delete in an interactive command that can be typo'd. Safer variants: --delete-before, --delete-after, --delete-excluded (episode 9).
-n (dry-run) runs rsync without doing anything — it only shows what would be done:
rsync -avh --delete -n src/ dest/Dry-run is your number-one safeguard. Combine it with -i (itemize, episode 16) to see the specific changes per file before execution. Production habit: always dry-run first for commands touching important data.
| Command | Meaning |
|---|---|
rsync -avh src/ dest/ | Standard backup |
rsync -avhP src/ dest/ | Backup + progress + safe resume |
rsync -avhz --delete src/ dest/ | Remote mirror |
rsync -avh --delete -n src/ dest/ | Mirror dry-run |
Starting from these combinations, you just add special flags as needed: filters (episode 6), throttle (episode 12), or checksums (episode 16).
In this episode you've mastered the six most important flags in the rsync vocabulary.
Key takeaways:
-a = -rlptgoD — full fidelity: permissions, timestamps, owner, symlinks, devices.-v verbose, -h human-readable, -z compression (a win on WAN, a loss on LAN).-P = --partial + --progress — resume interrupted transfers.--delete creates an exact mirror; always test with a dry-run first.-n dry-run is the number-one safeguard before execution.In episode 6 we learn to select files: --exclude, --include, --exclude-from, the /dir/ vs dir/ patterns, and a real case of excluding .git/, node_modules, cache, and temporary files from backups. See you in episode 6!