Rsync进行数据同步

来源:互联网 发布:ubuntu怎么删除软件 编辑:程序博客网 时间:2024/05/29 04:35

Rsync安装

shell > yum install rsync -y

[编辑]Rsync配置

  1. 创建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/motdport = 873max connections = 25syslog 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
原创粉丝点击