Unofficial practice
Rsync Dry-Run Backup
A backup or archive command is about to move data. Preview the file set and deletion behavior before running a write.
Linux One Liners is an independent study and practice resource. It is not affiliated with, endorsed by, or approved by LPI, The Linux Foundation, CompTIA, or any certification provider. This site does not provide exam dumps or real exam questions.
Try first
rsync -avhn --delete /srv/app/ /backup/app/
Troubleshooting ladder
- Name the symptom.
- Inspect read-only state.
- Find the owner, service, file, device, mount, or route.
- Read the decisive output field.
- Choose the next narrow command.
- Avoid broad or destructive changes.
- Make the smallest justified change if required.
- Verify and record what changed.
drill evidence
Sample output and answer key
Command anatomy
rsync -avhn --delete /srv/app/ /backup/app/
rsync/tar- inspect or preview archive and backup movement
dry-run/list flag- prove the file set before writing
source- where data comes from
destination/archive- where data would go or be restored from
Annotated output
sending incremental file list
.d..t...... ./
>f+++++++++ releases/app.tar.gz
>f.st...... current/config.yml
sent 2.1K bytes received 82 bytes 4.3K bytes/sec
What to notice
- itemize flag
- what rsync would change
- path
- which file would move
- sent/received
- how large the planned transfer looks
Safe vs unsafe move
Common wrong move
Running without dry-run before checking whether --delete would remove files.
Next safe command
rsync -avhn --delete /srv/app/ /backup/app/ | sed -n '1,40p'
Goal
Prove the condition with command output before changing the system.
Safe first command
rsync -avhn --delete /srv/app/ /backup/app/
Correct interpretation
The decisive fields are `itemize flag`, `path`, `sent/received`. The affected object is the path, user, address, or package named by the command output. The next safe command is `rsync -avhn --delete /srv/app/ /backup/app/ | sed -n '1,40p'` because it narrows the evidence without jumping to a broad fix. Watch out for this wrong move: Running without dry-run before checking whether --delete would remove files.
Next safe command
rsync -avhn --delete /srv/app/ /backup/app/ | sed -n '1,40p'
Common wrong move
Running without dry-run before checking whether --delete would remove files.
Self-check
Which listed path would be copied or deleted, and what dry-run line proves it?
source and objective
Related cert objective
Source status: Linux Foundation LFCS page verified June 30, 2026. LFCS is an online, proctored, performance-based command-line exam.
Related command pages
Why this matters
The point is not to memorize a flag. It is to read the evidence, name the next safe check, and avoid the tempting broad fix.