rsync
A file copying tool that sends only the parts that differ between source and destination, locally or over SSH.
With --delete, a wrong source or missing trailing slash can wipe files at the destination.
In more detail
-a preserves permissions, times and links, and --delete removes destination files that no longer exist in the source. A trailing slash on the source copies its contents rather than the directory itself, so notes/ and notes behave differently.
Example
rsync -a --delete notes/ deploy@web01:/srv/notes/Related terms
- scp — The command that copies files to or from another machine over SSH, written as user@host:path.
- SSH — A protocol for logging in to and running commands on another computer securely over a network.
Taught in
- Archives, Transfers And The Network — Bash Scripting & Command Line Automation
- Friday's Backup, Monday's Restore: Incrementals, Images And Compressed Logs — CompTIA Linux+ (XK0-006) Exam Prep