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
Chandra Shekhar
Latest posts by Chandra Shekhar (see all)
- Best practices for micro service design - January 23, 2022
- Spring Boot - January 23, 2022
- Java - January 23, 2022
Recent Comments