分类: LINUX
2008-07-29 05:15:29
linux应用 同步备份rsync 1安装 下载rsync安装包 #./configure --prefix=/usr/local/rsync# make# make install 2配置 1)#useradd wstatic 2)#more /etc/rsyncd.conf uid = wstatic gid = wstatic use chroot = no max connections = 50 timeout=600 #syslog facility = local5 pid file = /usr/local/rsync/logs/rsyncd.pid log file = /usr/local/rsync/logs/rsync.log lock file=/usr/local/rsync/logs/rsync.lock [WSHOME] path = / # path = /usr/local/zeus/htdocs/wstatic.xunlei.com comment = cnc-blog read # auth users = wstatic # secrets file = /etc/rsyncd.secrets 修改comment =为当前应用 3)/etc/rc.d/rc.local 中增加 /usr/bin/rsync --daemon --config=/etc/rsyncd.conf 并运行 /usr/bin/rsync --daemon --config=/etc/rsyncd.conf 4)修改/增加访问873端口 /etc/sysconfig/iptables 5)/etc/hosts.allow 和/etc/hosts.deny -------------------------------------------- 6)测试rsyncd 在本机 # rsync localhost:: WSHOME pub2-wstatic,pub3-p4p 在远端机上 #rsync biz78.sandai.net:: WSHOME tel-blog 注意: 防火墙要开873端口,hosts.allow要开rsync:xx.xx.xx.xx,,推向目录权限为配置文件中的用户 用法如下 rsync -avL yourfile |