配置/etc/rsyncd.conf
uid = 0 #用root,比较危险 gid = nobody use chroot = no # 不使用chroot max connections = 4 # 最大连接数为4 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log # 日志记录文件 #[inburst] # 这里是认证的模块名,在client端需要指定 #path = /home/inburst/python/ # 需要做镜像的目录 #comment = BACKUP CLIENT IS SOLARIS 8 E250 #ignore errors # 可以忽略一些无关的IO错误 #read only = yes # 只读 #list = no # 不允许列文件 #auth users = inburst # 认证的用户名,如果没有这行,则表明是匿名 #secrets file = /etc/inburst.pas # 认证文件名 [lsb] path = /home/lsb comment = lsb home [cvs] path = /u/cvsroot comment = cvs rep [freeradius] path = /usr/freeradius comment = freeradius用xinetd启动rsync。在另外一台机器中一些下面的backup.sh脚本就可以了
#! /bin/sh rsync -vzrtopg --progress --delete 192.168.0.2::cvs /u/backup/cvsroot rsync -vzrtopg --progress --delete 192.168.0.2::lsb /u/backup/lsb rsync -vzrtopg --progress --delete 192.168.0.2::freeradius /u/backup/freeradius最后加crontab,见 http://rsync.samba.org/