Linux rsync command Help and Examples

Update on:
Sep 4, 2021

The rsync command stands for Remote Synchronization.

The Linux command rsync is used to do a backup operation and fast copy file into the local system or remote system in UNIX/Linux.

Using rsync, you can perform file and directories synchronize from one location to another location and in the local system also. Your backup server location could be on a local server or remote server.

Suggested Reading: UNIX/LINUX Command – rsync

Suggested Reading: 15 Practicle examples of rsync command in real world

Essential features of the rsync command:

Speed – As rsync command is used to sync the file to another location, So the first time, it replicates all files and data between the source and destination directories. Next time, it checks modification and changes in both location and transfers only the changed blocks or bytes of information into the destination directories, which makes the file or directories transfer fast.

Security – the rsync command support data encryption during data transfer over SSH protocol.

Less Bandwidth– During synchronization of data between source and destination it using compression and decompression of data blocks by blocks at source and destination respectively. So, due to the compression of data rsync use less bandwidth compared to any other file transfer protocol.

Privileges – rsync is a very simple application; there is no requirement for any special rights to install and execute rsync command.

For rsync command syntax and options check here.

rsync command examples

Exampel 1 – Two directories synchronize in local server

$ rsync – zvr /var/www/website/   /root/tmp
building file list … done
sent 567890 bytes       received 67890 bytes    456789.00 bytes/sec
total size is 895678     speedup is 1.78

Example 2 – Only one file Synchronize

$ rsync –v /var/www/website/ssl.cert /root/temp
sent 64 bytes received 34567 bytes 3462.18 bytes/sec
total size is 23456 speedup is 1.32

Example 3 – Synchronize files to remote server from local system

$ rsync –avz /root/temp/ [email protected]:/home/linuxconcept/temp/
building file list … done
sent 23456782 bytes received 567 bytes 245673.34 bytes/sec
total size is 56345784 speedup is 3.54

Example 4 – Synchronize Files from remote server to local system

$ rsync –avz [email protected]:/var/lib/mysql /root/temp
receiving file list … done
sent 567 bytes received 5634526 bytes 523325.45 bytes/sec
total size is 563454525 speedup is 1.36

Related Posts

The 30 most useful Linux commands

This article will introduce some practical and common Linux or Unix command , which is the Linux system administrators normally use the command . This article is not a complete list, but a brief list of commands that can be useful...

15 Practical examples of tcpdump command

15 Practical examples of tcpdump command

The tcpdump is the most essential and powerful command-line network packet sniffing tool. We use it to analyze network packets, capture or filter TCP/IP packets that transferred and received over the network on a specific network interface. It is available in almost...

15 Useful “df” Commands to Check Disk Space in Linux

15 Useful “df” Commands to Check Disk Space in Linux

There are several Linux tools available on the internet to check disk space utilization; we can use any of them. But, Linux has a best built-in command-line utility called “df”. The “df” is the short form of “disk filesystem”, we can get detailed information on used...

15 Practical examples of echo command

15 Practical examples of echo command

If you are writing a bash script, you know echo command very well. It is use to display text lines on an output screen or a file. The echo command is the most common command used by all Linux users, and it is built-in Linux command. echo command syntax: echo...

Follow Us

Our Communities

More on Linux Command

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!



Submit a Comment

Your email address will not be published.

ten + 2 =