Rsync安装
shell > yum install rsync -y
[编辑]Rsync配置
- 创建rsync.conf配置文件, 保存至/etc下。配置文件参考附录,更多配置请参考http://rsync.samba.org/ftp/rsync/rsyncd.conf.html
[编辑]启动Rsync服务器
shell > rsync --daemon --config=/etc/rsyncd.conf
[编辑]Rsync数据同步
shell > rsync -avzP chaoying@192.168.2.222::wiki /wiki
[编辑]错误排查
[编辑]配置文件权限问题
错误描述:
rsync error: error starting client-server protocol (code 5) at main.c(1503)[receiver = 3.0.6] @ERROR: auth failed on module share.
错误原因:
在rsync.conf中配置的secrets file文件权限不正确。
解决方案:
shell > chmod 600 rsync.secrets
[编辑]更多参考资料
- http://rsync.samba.org/documentation.html
- http://en.wikipedia.org/wiki/Rsync
- http://baike.baidu.com/view/1183189.htm
[编辑]附录
[编辑]rsync.conf
motd file = /etc/motd port = 873 max connections = 25 syslog facility = local3 [share] path = /home/chaoying/share comment = ftp area list = yes read only = yes [wiki] path = /usr/local/apache2/htdocs/wki comment = MediaWiki web content. list = yes read only = yes