Rsync command For File and Folder backup in Linux

rsync is a great tool/command in linux that copies file from one location to another location.
Following are some of the cool features of rsync command:

*. Using this command we can even copy files from one server to another server by  using SSH.
*. It synchronises source and destination folder. That means even the files or folders can be copied partially not in one go. So this is beneficial in case of power failure or any other case of failure.
*. This will work for recursive folder transfer
*. During recurring file transfer you can ignore multiple files or directories.

Below are some of the example of rsync command

rsync Command to copy file from remote server to local system

$ rsync -arv [email protected]:/home/folder/ /home/cute/folder/

Command that copy from source to destination with excluding a folder from source to destination

$ rsync -avz –exclude ‘dir1’ source/ destination/

Rsync command from one server to local machine using SSH
$ rsync -avz -e ssh –progress user@server:/home/ /home/home-backup/

Following are the option
a = archive – this option preserves permissions (owners, groups), times, symbolic links, and devices from source to destination.
r = recursive – this option copies directories and sub directories
v = verbose – this option prints on the screen what is being copied
z = compress – compress file or data during transfer

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video Conferencing and social media domain. The motive of creating cutehits was just to share the knowledge/solutions I get to know during my day to day life so that if possible I can help someone for same problems/solutions. CuteHits.com is a really a very effort for sharing knowledge to rest of the world. For any query/suggestion about same you can contact me on below details:- Email: shekharmca2005 at gmail.com Phone: +91-9560201363

Latest posts by Chandra Shekhar (see all)

You may also like...