Skip to content
linuxdata-protection

rsync

rsynclinuxtools
Plain English

rsync copies files smartly. The second time you run it, it only sends what changed, which makes it ideal for backups.

Technical Definition

rsync compares files by size and time (or checksum with -c) and sends deltas.

  • rsync -av src/ dest/ (trailing slash on src means its contents).
  • -n dry run, --delete mirrors deletions, -z compresses, -P shows progress and resumes.
  • Over SSH: rsync -av dir/ user@host:dir/.

Source: rsync(1)

rsync in practice

$ rsync -avn ~/site/ dev1@192.168.56.11:site/
$ rsync -av --delete ~/site/ dev1@192.168.56.11:site/
In the Wild

Always run with -n first when using --delete. rsync is behind countless home and business backup scripts.