关于rsync同步导致目录层数问题:
[oracle@june2 ~]$ rsync -avH --delete /oracle/test oracle@10.10.17.3:/oracle/test
building file list ... done
test/
test/diag/
test/diag/clients/
test/diag/clients/user_oracle/
test/diag/clients/user_oracle/host_3393483183_76/
test/diag/clients/user_oracle/host_3393483183_76/alert/
test/diag/clients/user_oracle/host_3393483183_76/alert/log.xml
test/diag/clients/user_oracle/host_3393483183_76/alert/log_1.xml
test/diag/clients/user_oracle/host_3393483183_76/cdump/
sent 22085635 bytes received 626 bytes 14724174.00 bytes/sec
total size is 22080840 speedup is 1.00
如果使用rsync -avH --delete /oracle/test oracle@10.10.17.3:/oracle/test 同步方式:
那么在10.10.17.3上的目前结构会变化成如下:
[oracle@june3 test]$ pwd
/oracle/test
[oracle@june3 test]$ ls -ltr
总计 4
drwxr-x--- 3 oracle dba 4096 06-25 07:59 test
会多出一层test目录
必须写成这样:
[oracle@june2 ~]$ rsync -avH --delete /oracle/test/ oracle@10.10.17.3:/oracle/test/
带上斜杠