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.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ find source backup -type f | sort
backup/.snapshot
backup/app/config.yml
backup/content/index.md
backup/old-report.csv
backup/tmp/empty.cache
source/app/config.yml
source/assets/logo.svg
source/content/about.md
source/content/index.md
$ rsync -ain --delete source/ backup/
*deleting tmp/empty.cache
*deleting tmp/
*deleting old-report.csv
*deleting .snapshot
cd+++++++++ assets/
>f+++++++++ assets/logo.svg
>f+++++++++ content/about.md
>f.st...... content/index.md
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
find source backup -type f | sortrsync -ain --delete source/ backup/
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.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.