# rsync

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

**Field:** Infrastructure  
**Category:** SSH & Remote Access  
**Also known as:** rsync Command, rsync over SSH, Remote Sync

## Think of it like

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

## 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

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

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

- **Only changes.** Skips what is already there.
- **Over SSH.** Same login and keys.
- **Mind the slash.** It changes what is copied.

## Related terms

- [scp](https://learn.benibix.com/term/infrastructure/scp)
- [SSH File Transfer Protocol (SFTP)](https://learn.benibix.com/term/infrastructure/sftp)
- [Secure Shell (SSH)](https://learn.benibix.com/term/infrastructure/ssh)
- [Directory](https://learn.benibix.com/term/development/directory)

## Told apart from

- [scp vs rsync](https://learn.benibix.com/compare/scp-vs-rsync): People often think rsync is just a faster scp, since both copy files to a server. Both go over SSH, but scp sends the whole file every time. rsync checks what is already there first, and sends only what changed. For one file once, scp is fine. For a big folder you copy again and again, rsync wins.

## Taught in

- [scp, SFTP and rsync](https://learn.benibix.com/learn/infrastructure-ssh/scp-sftp-and-rsync): SSH, 7/9

![Three lanes, each running from a laptop to a server through the same SSH tunnel. In the scp lane, one file is copied once. In the sftp lane, a session lists folders and uploads a file, like a file manager. In the rsync lane, a folder of ten files is checked and only the two changed files are sent.](https://learn.benibix.com/diagrams/inf3-file-transfer.svg)

---

Source: https://learn.benibix.com/term/infrastructure/rsync
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
