# Rsync (873)

<details>

<summary>Protocol Information</summary>

Rsync is used to synchronize files and directories between two systems efficiently. This protocol allows copying only those parts of files that have changed. It is often used for backups, data transfers, or maintaining synchronized copies between servers or local devices.

</details>

## Port

<table data-header-hidden><thead><tr><th width="166">Port</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><strong>873</strong></mark><strong> TCP</strong></td><td>Rsync daemon</td></tr></tbody></table>

## Interact

If **anonymous access** is enabled, it's possible log in with username `“anonymous”` and password `“”`.

Listing a share and object:

{% code overflow="wrap" %}

```bash
rsync --list-only <USER>@<IP>::
```

{% endcode %}

{% code overflow="wrap" %}

```bash
rsync --list-only <USER>@<IP>::<SHARE>
```

{% endcode %}

Download a file:

{% code overflow="wrap" %}

```bash
rsync --list-only <USER>@<IP>::<SHARE>/<FILE> ./<NEW_NAME>
```

{% endcode %}

## Backup

Back up `<LOCAL>` to `<REMOTE>`

{% code overflow="wrap" %}

```bash
rsync -av <PATH_LOCAL> <USER>@<IP>:<PATH_REMOTE>
```

{% endcode %}

Restore `<REMOTE>` to `<LOCAL>`

{% code overflow="wrap" %}

```bash
rsync -av <USER>@<IP>:<PATH_REMOTE> <PATH_LOCAL>
```

{% endcode %}
