Pages

Saturday, May 2, 2020

RSYNC Usage Examples

RSYNC Usage Examples


An Example:  this will replicate the directory mqmrsynctest located on the local machine rac1 to the remote machine rac2

oracle@rac1 backup]$ rsync -avzh ./MQMRSYNCTEST oracle@rac2:/home/oracle/backup
oracle@rac2's password:
sending incremental file list
MQMRSYNCTEST/
MQMRSYNCTEST/mqmtest
MQMRSYNCTEST/test1
MQMRSYNCTEST/test10
MQMRSYNCTEST/test2
MQMRSYNCTEST/test3
MQMRSYNCTEST/test4
MQMRSYNCTEST/test5
MQMRSYNCTEST/test6
MQMRSYNCTEST/test7
MQMRSYNCTEST/test8
MQMRSYNCTEST/test9
MQMRSYNCTEST/test01/
MQMRSYNCTEST/test02/
MQMRSYNCTEST/test03/
MQMRSYNCTEST/test04/
MQMRSYNCTEST/test05/
MQMRSYNCTEST/test06/
MQMRSYNCTEST/test07/
MQMRSYNCTEST/test08/
MQMRSYNCTEST/test09/

sent 1.21K bytes  received 267 bytes  423.14 bytes/sec
total size is 1.20K  speedup is 0.81

[oracle@rac2 MQMRSYNCTEST]$ ls -l
total 40
-rw-r--r-- 1 oracle oinstall 1200 May  2 15:16 mqmtest
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test01
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test02
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test03
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test04
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test05
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test06
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test07
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:17 test08
drwxr-xr-x 2 oracle oinstall 4096 May  2 15:18 test09
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test1
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test10
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test2
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test3
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test4
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test5
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test6
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test7
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test8
-rw-r--r-- 1 oracle oinstall    0 May  2 15:17 test9
[oracle@rac2 MQMRSYNCTEST]$


RSYNC FAQ's

1. Is Rsync replication encrypted?  -----   
Yes it can be, for example you could use rsync in conjunction with ssh : rsync -avzhe ssh oracle@rac1:/home/oracle//MQMRSYNCTEST /home/oracle/

2. In case of disconnection, will Rsync resend the package without any loss of data 
You would need to initiate another rsync operation to continue syncing the folders

3. Can Rsync be used with separate Ethernet on a private network? 
any TCP based network connection will work

4. Will Rsync affect the Server performance ?
Execution of any additional command will impact a machines performed,  whether it impacts performance to the point others notice it would be dependent on the to many variables to give you a definitive answer.  What volume of information is being read on the node and written to the receiving node, what are the specs of the machines involved, how fast is the network, how fast is the storage involved etc etc...

Note the rsync commands here have been implemented through a linux environment, they may differ across the unix variants.

No comments:

Post a Comment