Breaking Down rsync -avz --delete: What Each Flag Actually Does
The rsync command is widely used in deployment scripts, but its flags are rarely examined in detail. The -a flag is not a single option but a bundle that enables recursive copying while preserving permissions, timestamps, symlinks, and ownership. The -v and -z flags add verbose output and in-transit compression respectively, while --delete removes destination files that no longer exist in the source. Crucially, --delete only affects the specific destination directory specified, meaning its impact is limited to that scoped path and does not touch sibling directories. Understanding these flags helps developers predict exactly how rsync behaves and avoid unintended file deletions during deployment.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in