Skip to content
BENIBIX Learn

rsync

Infrastructure🔑 SSH & Remote AccessFile Transfer

Also known as rsync Command, rsync over SSH, Remote Sync

A tool that makes two folders match. It sends only what changed.

Think of it like

Think of it like packing for a trip. You only pack what is not there yet.

Example

Lucy's website has 2,000 files. She edits two of them, runs rsync, and only those two travel to the server.

Why it matters

Big copies you make again and again take seconds, not minutes.

Definition

rsync copies files and folders so that two places end up the same. It first checks what is already there. Then it sends only the files, or parts of files, that changed. It usually runs over SSH. That makes the second copy of a big folder far faster than the first.

Example code

bash
rsync -av site/ lucy@203.0.113.10:/var/www/site/
Make the folder on the server match the one on the laptop. Only changes are sent.
In the rsync lane, ten files are checked and only the two changed ones are sent.

Common mistake

Getting the slash at the end of the source wrong. site/ copies what is inside, and site copies the folder itself.

Key takeaways

  1. 1
    Only changes. Skips what is already there.
  2. 2
    Over SSH. Same login and keys.
  3. 3
    Mind the slash. It changes what is copied.

Compare

Learn it properly