源:172.0.0.2
目标: 172.0.0.3
目标配置:
uid = root
gid = root
read only = no
hosts allow = *
[gitlab]
path = /data/store/gitlab/gitlab
comment = gitlab
secrets file = /etc/rsyncgitlab.password
asdfljaf@#akdf123dFF
启动rsync 守护进程
rsync --daemon --config=/etc/rsyncd.conf
源设置:
将密码文件放到源机器上
/etc/rsynccloud.passwd
源上脚本:
#/bin/bash
src2="/data/store/cloud/"
dst2="/data/store/cloud/"
/usr/local/bin/inotifywait -mrq -e create,delete,modify,move $src2 | while read line; do
rsync -arp -go --delete --password-file=/etc/rsynccloud.passwd/data/store/cloud/root@172.0.0.3::cloud
echo -n "$line " >> /tmp/inotify.log
done
http://www.jb51.net/article/31920.htm
问题集锦
rsync -arp -go --password-file=/etc/rsynccloud.passwd cloud.tgz root@172.0.0.3::cloud