首页 > 代码库 > rsync
rsync
参考:http://www.cnblogs.com/itech/archive/2009/08/10/1542945.html
yum -y install rsync
配置文件
vim /etc/rsyncd.conf
# /etc/rsyncd: configuration file for rsync daemon mode # See rsyncd.conf man page for more options. # configuration example: uid = nobody gid = nobody use chroot = no max connections = 4 pid file = /var/run/rsyncd.pid # exclude = lost+found/ # transfer logging = yes timeout = 900 # ignore nonreadable = yes # dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 # [ftp] # path = /home/ftp # comment = ftp export area [csmh] path = /home/wwwroot/csmh auth users = zhong ignore errors secrets file = /etc/rsyncd.secrets #exclude = cache/ [gjml] path = /home/wwwroot/gjml auth users = zhong ignore errors secrets file = /etc/rsyncd.secrets #exclude = cache/ [xian] path = /home/wwwroot/xian auth users = zhong ignore errors secrets file = /etc/rsyncd.secrets
密码文件
vim /etc/rsyncd.secrets
zhong:123456
客户端同步
从服务端拉取
rsync -avzP zhong@47.93.123.70::csmh rr --delete --password-file=/etc/rsyncd.secrets
/etc/rsyncd.secrets 文件内容为密码
123456
往服务端推送
rsync -avzP /home/tt.txt zhong@47.93.123.70::csmh --delete --password-file=/etc/rsyncd.secrets
rsync
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。