Linux rsync command Help and Examples

April 13, 2019

Comments

Adsense

Adsense

Adsense

Adsense

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
index.html
home.html
.
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
ssl.cert
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/
Password:
building file list … done
./
satish/
satish/test.txt
satish/test001.txt
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
Password:
receiving file list … done
mysql/
mysql/mysql.mdb
.
sent 567 bytes received 5634526 bytes 523325.45 bytes/sec
total size is 563454525 speedup is 1.36
$
Satish Kumar

Satish Kumar

I am Satish Kumar, Founder of LinuxConcept. Linux and F.O.S.S enthusiast, love to work on open source platform and technologies.

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

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

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

3 + 2 =

News & Updates

Join Our Newsletter

Adsense

Adsense

Adsense

Adsense