Preview an rsync mirror that would delete extra destination files
Build a paste-ready command, then review its compatibility and effects before running it.
rsync -avhn --delete --itemize-changes <source> <destination>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Dry run firstThe rsync manual specifically recommends --dry-run before using --delete.
Operational knowledgereview due 2027-01-19
Requirementsrsyncrsync must be installed and available on PATH.
Version supportrsync Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals*deleting obsolete.isoRepresentative successful output; values vary with the selected target and system state.
Known errorsrsync: command not foundrsync is missing or is not available on PATH.
Verifyrsync -avhn --delete --itemize-changes {{source}} {{destination}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01rsyncCommandRuns the rsync stage of this one-liner.
02-avhnOptionCombines archive mode, verbose output, human-readable sizes, and a dry run.
03--deleteOptionRemoves destination entries that are absent from the source.
04--itemize-changesOptionPrints a compact change code for every affected path.
05<source>ParameterA value supplied in the Fill parameters section.
06<destination>ParameterA value supplied in the Fill parameters section.
Example input
rsync -avhn --delete --itemize-changes source/ mirror/
Example output
*deleting obsolete.iso
>f+++++++++ release-2026.07.iso
>f.st...... SHA256SUMS
Illustrative output — exact values vary by system and data.
Official sources
Related commands