rsync — file synchronization and copying
cheat sheet · rsync 3.x https://lab.dimsanych.ru/en/wiki/rsync/Cheat sheet
-
rsync -avzP src/ dst/sync (changes only, with progress) -
rsync -avzP src/ user@host:/dst/over SSH -
rsync -avzn --delete src/ dst/dry-run a mirror FIRST -
rsync -avz --exclude='cache/' src/ dst/ -
rsync -av --link-dest=/bak/prev src/ /bak/today/snapshot backup - remember the trailing / on the source
Options
-n (dry-run) shows what would change without writing a single byte to
disk — always check a command with --delete this way before removing the
flag. -a does not include deletion in the destination: without
--delete, rsync only adds and updates files, it never removes anything
extra.