MobaXterm is a wonderful tool for every DevOps engineer. Today let us explore the rsync command with mobaxterm bash terminal to copy or sync files between

Example use of rsync command in mobaxterm


Let us have two directories, 1 source, 1 destination:
Code:
[admin@devopsrun1 test]$ ls -l
total 0
drwxrwxr-x 2 admin admin   6 Nov  2 04:49 destination
drwxrwxr-x 2 admin admin 159 Oct 25 01:19 source
The source directory is having a few files in it,
Code:
[admin@devopsrun1 test]$ ls source/
file1.txt  file2.txt  file3.txt  file4.txt  file5.txt  file6.txt  file7.txt  file8.txt  file9.txt
Destination directory is empty.
Code:
[admin@devopsrun1 test]$ ls destination/
[admin@devopsrun1 test]$

Let us sync files from source to destination directory using rsync


Code:
[admin@devopsrun1 test]$ rsync -av source/ destination/
sending incremental file list
./
file1.txt
file2.txt
file3.txt
file4.txt
file5.txt
file6.txt
file7.txt
file8.txt
file9.txt

sent 568 bytes  received 190 bytes  1,516.00 bytes/sec
total size is 0  speedup is 0.00
We used rsync with v, so it is showing verbose details.

Verifying the destination after rsync


Code:
[admin@devopsrun1 test]$ ls destination/
file1.txt  file2.txt  file3.txt  file4.txt  file5.txt  file6.txt  file7.txt  file8.txt  file9.txt