---
title: "How to Use Rsync to Sync Local and Remote Directories - CloudBlast"
description: "How to Use Rsync to Sync Local and Remote Directories"
url: "https://cloudblast.io/ja/article/How-to-Use-Rsync-to-Sync-Local-and-Remote-Directories"
language: "ja-JP"
---

ブログ

# How to Use Rsync to Sync Local and Remote Directories

登録で5€の無料残高がもらえる

CloudBlastに登録して、VPSをデプロイするための5€分のクラウドクレジットを獲得しましょう

[無料の5€を受け取る](https://console.cloudblast.io/auth/login?ref=2)

-   [戻る](https://cloudblast.io/ja)
-   [すべての記事](https://cloudblast.io/ja/blog)

2024-09-20

### How to Use Rsync to Sync Local and Remote Directories

tutorials

Rsync is a powerful tool for synchronizing files and directories between local and remote systems. It is widely used in Linux/Unix environments for its efficiency and flexibility in data transfer tasks.

**Prerequisites**

To practice using rsync, you will need two machines: one to act as your local computer and another as your remote machine.

**Basic Rsync Command**

The basic syntax for rsync is as follows:

> `rsync [options] source destination`

**Synchronizing Directories**

To synchronize a local directory with a remote directory, you can use the following command:

> `rsync -avz /local/directory/ remote_user@remote_host:/remote/directory/`

\- **\-a**: Archive mode, which preserves permissions, times, symbolic links, and more.
\- **\-v**: Verbose output, showing the progress of the synchronization.
\- **\-z**: Compresses data during transfer for faster performance.

**Using Rsync with SSH**

Rsync can be used over SSH for secure data transfer. If your SSH server is running on a non-standard port, you can specify it using the -e option:

> `rsync -avz -e "ssh -p 2222" /local/directory/ remote_user@remote_host:/remote/directory/`

**Deleting Files**

To ensure that the destination directory is an exact copy of the source, including deletions, use the --delete option:

> `rsync -avz --delete /local/directory/ remote_user@remote_host:/remote/directory/`

**Conclusion**

Rsync is a versatile tool that can handle a variety of synchronization tasks between local and remote directories. By using options like -a, -v, -z, and --delete, you can customize the synchronization process to meet your specific needs.

シェア

## 続きを読む

[2026-07-25 How to Install and Set Up Mailcow on Ubuntu and Debian VPS tutorials](https://cloudblast.io/article/how-to-install-and-setup-mailcow-on-ubuntu-and-debian-vps)

[2026-07-25 How to Install Chatwoot on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-chatwoot-on-ubuntu-and-debian-server)

[2026-07-25 How to Install Mattermost on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-mattermost-on-ubuntu-and-debian-server)

[2026-07-25 How to Install RustDesk on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-rustdesk-on-ubuntu-and-debian-server)
