介紹centos
實驗1.ssh
[root@centos001 ~]# rsync -av /etc/passwd /tmp/1.txt sending incremental file list passwd sent 1446 bytes received 31 bytes 2954.00 bytes/sec total size is 1372 speedup is 0.93
rsync -av /tmp/1.txt 192.168.188.128:/tmp/2.txt
---------選項 --------源目錄--目標文件 rsync [OPTION] … SRC DEST rsync [OPTION] … SRC [user@]host:DEST //遠程拷貝 rsync [OPTION] … [user@]host:SRC DEST //遠程到本地 rsync [OPTION] … SRC [user@]host::DEST //兩個冒號 rsync [OPTION] … [user@]host::SRC DEST
rsync經過ssh方式同步 rsync -av test1/ 192.168.133.132:/tmp/test2/ rsync -av -e "ssh -p 22" test1/ 192.168.133.132:/tmp/test2/ rsync 經過服務的方式同步 要編輯配置文件/etc/rsyncd.conf 啓動服務rsync --daemon 格式:rsync -av test1/ 192.168.133.130::module/dir/code