`rsync -avz` Is the Command You Use When You Need Repeatable File Sync, Not Another Fragile Manual Copy That Forgets Half the Story
A practical guide to `rsync -avz` for syncing files and directories between machines with compression and metadata preservation instead of relying on repetitive manual copy steps.
Why this command matters: once file transfer becomes repeat work, manual copy steps stop being efficient and start becoming a source of drift.
rsync -avz remains one of the most practical commands for syncing files between local and remote machines. It is especially useful when you need repeatability, compression, and a better story than “I copied the folder again and hoped it matched.”
The command
rsync -avz ./dist/ [email protected]:/var/www/my-app/The flags matter:
-aarchive mode for metadata-preserving sync-vverbose output-zcompression during transfer
That combination is a very solid default for many deployment and backup-like workflows.
Why it helps
It is useful when:
- you repeatedly sync build output to a server
- logs or datasets need to move efficiently
- preserving file structure matters
- you want a shell command that can go into a runbook or script
This is exactly the kind of task where repeatability beats manual copying.
Final recommendation
If files need to be synced more than once, prefer rsync -avz over ad hoc copy rituals. It is still one of the most practical ways to move real directory state with less drift and better repeatability.