介绍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