Rsync, What is Rsync over SSH?, Hostripples Web Hosting

What is Rsync over SSH?

Table of Contents

Rsync is a very flexible network-enabled syncing tool. It can also refer to the network protocol developed to utilize this tool.  Rsync stands for Remote Sync. Normally rsync is used to transfer file from one server (source) to another server (destination).

Basic Syntax

1)  Create some test files with the following commands:

cd ~
mkdir dir1
mkdir dir2
touch dir1/file{1..100}

2)  Directory called dir1 with 100 empty files in it.

ls dir1
file1    file18  file27  file36  file45  file54  file63  file72  file81  file90
file10   file19  file28  file37  file46  file55  file64  file73  file82  file91
file100  file2   file29  file38  file47  file56  file65  file74  file83  file92
file11   file20  file3   file39  file48  file57  file66  file75  file84  file93
file12   file21  file30  file4   file49  file58  file67  file76  file85  file94
file13   file22  file31  file40  file5   file59  file68  file77  file86  file95
file14   file23  file32  file41  file50  file6   file69  file78  file87  file96
file15   file24  file33  file42  file51  file60  file7   file79  file88  file97
file16   file25  file34  file43  file52  file61  file70  file8   file89  file98
file17   file26  file35  file44  file53  file62  file71  file80  file9   file99

3) Empty directory called dir2.

Then,

4)  Contents of dir1 to dir2 on the same system, type:

rsync -r dir1/ dir2

The -r option means recursive, which is necessary for directory syncing.

5)  Use the -a flag instead:

rsync -a dir1/ dir2

The -a option is a combination flag.

It stands for “archive” and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.

It is more commonly used than -r and is usually what you want to use.

Advantages of Rsync

1, Secure
2, Faster
3, Sutable for recurring tasks


What is Rsync over SSH?, Hostripples Web Hosting
Vishwajit Kale
Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostripples, a company that aims to provide affordable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.