practice task
Preview What rsync --delete Would Remove
You need to mirror a release directory to a backup target, but stale files on the target should be removed. Before running the real sync, you must preview deletions.
Independent study support only. No affiliation, endorsement, exam dumps, or guaranteed exam results.
Try first
rsync -ani --delete /srv/app/releases/current/ /backup/app/current/
Goal
Run a dry run that itemizes changes and clearly shows delete candidates.
Expected output
An itemized dry-run list. Lines beginning with *deleting identify files that would be removed from the target during the real run.
Teaches
Dry runs make destructive sync behavior reviewable before it touches files.
Common mistake
Forgetting the trailing slash distinction on rsync paths or running --delete without reviewing a dry run.
command set
Commands to know
rsync -av --dry-run --delete source/ target/rsync -ani --delete source/ target/grep '^*deleting'
Watch this command run
Example output from a temporary Linux lab
Preview rsync Before It Changes Files
Review the related command card and compare your expected output with the command replay.
Watch command runItemize a Backup rsync Dry Run
Review the related command card and compare your expected output with the command replay.
Watch command runnext practice
List Failed systemd Units
After a reboot, a host is reachable but something feels broken. You need a quick inventory of failed units before digging into individual logs.