一.安装
yum install rsync检查安装是否成功rpm -qa|grep rsync二.配置
(1)rsync.conf的配置文件uid = rootgid = rootuse chroot = nomax connections = 5pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.locklog file = /var/log/rsyncd.logsecrets file = /etc/rsync/rsync.pwd[store]
path = /www/www.itvpad.com/comment = backupignore errors = yesread only = nolist = nohosts allow = 10.0.1.161,10.0.1.219auth users = testuser(2)rsync.pwd
服务器密码文件(用户:密码)是一个密码文件随便自己定义的但权限一定要设成 600密码文件内容示例:testuser:hell05achmod 600 /etc/rsync/rsync.pwd客户端密码文件(只有密码)
三.启动
/usr/bin/rsync --daemon --config=/etc/rsync/rsync.conf查看是否启动成功:ps -aux |grep rsync 四.客户端同步命令/usr/bin/rsync -av /var/log/www.solive.kv/access_log --password-file=/etc/client/rsync.pwd
注意:采用推送方式同步文件
如:推送方10.0.1.163 执行客户端同步命令脚本,配置密码文件接受方10.0.1.162 需要安装rsync,rsync.conf,启动服务,配置密码文件