Hosting Operations
Dry run / previewPreview Backup Drift with rsync
You need to see source-to-backup drift without modifying the backup.
Command
rsync -ain --delete source/ backup/
Before you run this
System impact: Preview only. Still verify source and destination paths before running the real command.
When not to use it: Do not remove -n or keep --delete in a live sync until you understand every itemized change.
Expected output
Itemized rsync changes that would update, create, or delete files.
System impact
Dry run / preview. Nothing changes while -n is present; rsync only reports what would update, create, or delete.
When to use it
Use before syncing backups, especially when the real command may delete stale files.
When not to use it
Do not remove -n or keep --delete in a live sync until you understand every itemized change.
Recovery / rollback
No undo needed for the dry run. If you later remove -n, take a backup or snapshot first.
next steps
Related commands
Compare Source and Backup File Lists
A backup can be missing files and still look plausible at a glance.
comm -3 <(find source -type f | sed 's#^source/##' | sort) <(find backup -type f | sed 's#^backup/##' | sort)
Find Files Newer Than a Backup Snapshot
Files newer than the last snapshot are the ones most likely missing from it.
find source -type f -newer backup/.snapshot -print | sort
Run Rsync Without Deleting Your Backup
One rsync flag can save you. Another can erase the wrong side.
rsync -avhn --delete ./source/ ./backup/
Preview What Rsync Would Delete
`rsync --delete` is useful. It is also how people erase the wrong side.
rsync -avhn --delete ./source/ ./backup/ | grep '^deleting'
Create a SHA256 Checksum Manifest
A file list says what exists; checksums say whether bytes match.
sha256sum source/app/config.yml source/content/index.md source/content/about.md source/assets/logo.svg
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.