大佬教程收集整理的这篇文章主要介绍了CentOS 6.5 rsync服务的安装与配置,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
参数 | 说明 | 默认值 |
exclude | 指定多个由空格隔开的多个文件或目录(相对路径),并将其添加到 exclude 列表中。这等同于在客户端命令中使用 –exclude 来指定模式。 | 空 |
exclude from | 指定一个包含 exclude 规则定义的文件名,服务器从该文件中读取 exclude 列表定义。 | 空 |
include | 指定多个由空格隔开的多个文件或目录(相对路径),并将其添加到 include 列表中。这等同于在客户端命令中使用 –include 来指定模式 。 | 空 |
include from | 指定一个包含 include 规则定义的文件名,服务器从该文件中读取 include 列表定义。 | 空 |
# yum -y install gcc gcc-c++ @H_753_230@make perl wget rsync
[[email protected] data]# vi /etc/@H_403_288@rsyncd.conf uid =@H_403_288@ nobody gid =@H_403_288@ nobody use chroot =@H_403_288@ no max connections = 200@H_403_288@ timeout = 300@H_403_288@ pid file = /var/run/@H_403_288@rsyncd.pid lock file = /var/run/@H_403_288@rsync.lock log file = /var/log/@H_403_288@rsyncd.log [donglq] path = /donglq/@H_403_288@ ignore errors read only = false@H_403_288@ list = false@H_403_288@ hosts allow = 192.168.0.0/24@H_403_288@ hosts deny = 0.0.0.0/32@H_403_288@ auth users =@H_403_288@ rsync_BACkup secrets file = /etc/@H_403_288@rsync.password [data] path = /data/@H_403_288@ gnore errors read only = false@H_403_288@ list = false@H_403_288@ hosts allow = 192.168.0.0/24@H_403_288@ hosts deny = 0.0.0.0/32@H_403_288@ auth users =@H_403_288@ rsync_BACkup secrets file = /etc/rsync_data.password
pid file = /var/run/@H_403_288@rsyncd.pid log file = /var/log/@H_403_288@rsyncd.log lock file=/var/run/@H_403_288@rsyncd.lock secrets file = /etc/@H_403_288@rsyncd.pw [chAnnel] path = /home/b2b/tomcat-9400-chAnnel/webapps/@H_403_288@ROOT comment =@H_403_288@ chAnnel port = 873@H_403_288@ uid =@H_403_288@ b2b gid =@H_403_288@ b2b timeout = 600@H_403_288@ max connections = 200@H_403_288@ use chroot =@H_403_288@ no read only =@H_403_288@ yes list =@H_403_288@ no hosts allow = 10.34.200.195@H_403_288@ hosts deny = *
@H_403_288@添加如下内容: #/etc/@H_403_288@rsyncd.conf #pid文件的存放位置 pid file = /var/run/@H_403_288@rsyncd.pid #日志文件位置,启动rsync后自动产生这个文件,无需提前创建 log file = /var/log/@H_403_288@rsyncd.log #@L_972_8@max connections参数的锁文件 lock file=/var/run/@H_403_288@rsyncd.lock #用户认证配置文件,里面保存用户名称和密码 secrets file = /etc/@H_403_288@rsyncd.pw #rsync启动时欢迎信息页面文件位置 motd file = /etc/@H_403_288@rsyncd.motd transfer logging =@H_403_288@ yes log format = %t %a %m %f %@H_403_288@b syslog facility =@H_403_288@ local3 #自定义名称 [data] #设置需要同步的目录 path = /data/@H_403_288@ #模块名称与[data]自定义名称相同 comment =@H_403_288@ data 指定/data目录下不需要同步的目录:exclude = dd@H_403_288@,aa #默认端口 port = 873@H_403_288@ #设置rsync运行ID号或账户名称,默认为nobody uid =@H_403_288@ nobody #设置rsync运行GID号或账户名称,默认为nobody gid =@H_403_288@ nobody #设置超时时间 timeout = 600@H_403_288@ #最大连接数 max connections = 200@H_403_288@ #默认为true,修改为no,增加对目录文件软连接的备份 use chroot =@H_403_288@ no #设置rsync服务端文件为只读 read only =@H_403_288@ yes #不显示rsync服务端资源列表 list =@H_403_288@ no #允许进行数据同步的备份节点IP地址 hosts allow = 192.168.0.112@H_403_288@ #设置拒绝所有(除hosts allow定义的主机外) hosts deny = *
echo "rsync_BACkup:123456" >/etc/@H_403_288@rsync.password chmod 600 /etc/@H_403_288@rsync.password echo "rsync_BACkup:123456" >/etc/@H_403_288@rsync_data.password chmod 600 /etc/rsync_data.password
[[email protected] data]@H_753_230@mkdir /@H_403_288@donglq [[email protected] data]@H_753_230@mkdir /@H_403_288@data [[email protected] data]chmod 600 /donglq /@H_403_288@data [[email protected] data]chown nobody.nobody /data /donglq
@H_403_288@设置开机启动(源节点) # echo "/usr/bin/rsync --daemon">>/etc/rc.d/rc.local
rsync -avH [email protected]10.34.200.215::data /home/b2b/data/@H_403_288@ rsync -avH --delete --exclude=/home/b2b/data/ROOT/WEB-INF/classes/aggregation.properties [email protected]10.34.200.215::chAnnel /home/b2b/@H_403_288@data rsync -avH --delete --exclude=aggregation.properties [email protected]10.34.200.215::chAnnel /home/b2b/@H_403_288@data 0 * * * * rsync -avH [email protected]10.34.200.75::data /opt/data75/ > /dev/null 2>&1 0 * * * * rsync -avH [email protected]10.34.200.11::data /opt/zicai_phone/huichuan/ > /dev/null 2>&1
以上是大佬教程为你收集整理的CentOS 6.5 rsync服务的安装与配置全部内容,希望文章能够帮你解决CentOS 6.5 rsync服务的安装与配置所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。