rsync linux code example

Example 1: rsync from remote to local

rsync -chavzP --stats [email protected]:/path/to/copy /path/to/local/storage

Example 2: rsync examples

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.

rsync command examples

# rsync options source destination

$ rsync – zvr /var/www/website/   /root/tmp
$ rsync –avz /root/temp/ [email protected]:/home/linuxconcept/temp/
$ rsync –avz [email protected]:/var/lib/mysql /root/temp

Example 3: rsync remotely

for working in windows subsystem for lynux enter the following:
rsync -r work_server:location_of_work /mnt/c/directory_to_store

Example 4: how to rsync linux

rsync options source destination

Example 5: rsync sync remote dir

rsync -a ~/dir1 username@remote_host:destination_directory