FreeBSD rsync server:192.168.1.108
FreeBSD rsync server:192.168.1.109
Server:
Setp1:
#cd /usr/ports/net/rsync
#Make install clean
Setp2:
#ee /usr/local/etc/rsyncd.conf
Pid file=/var/run/rsyncd.pid
Port=873
Uid=nobody
Gid=nogroup
Use chroot=yes
Read only=yes
Maxconnections=5
Syslog facility=local5
[www]
Comment=this is test!
Ignore errors
Path =/www
Auth user=root
Secrets file=/usr/local/etc/rsyncd.secrets
Read only =no
Setp3:
#cd /usr/local/etc/
#touch rsyncd.secrets
#ee ./rsyncd.secrets
Root:root
#chmod 600 ./rsyncd.secrets
Setp4:
#ee /etc/rc.conf
添加:rsyncd_enable="YES"
Setp5:
#/usr/local/etc/rc.d/rsyncd start
测试:/usr/local/bin/rsync -list -only 192.168.1.108::www
Client:
Setp1:
#cd /usr/ports/net/rsync
#Make install clean
Setp2:
#cd /usr/local/etc/
#touch rsyncd.secrets
#ee ./rsyncd.secrets
添加:root
#chmod 600 ./rsyncd.secrets
Setp3:
建立同步存放文件的文件夹
#mkdir /www
测试:/usr/local/bin/rsync -list -only 192.168.1.108::www
同步文件:
#/usr/local/bin/rsync -avz --delete rsync://root@192.168.1.108/www /www --password-file=/usr/local/etc/rsyncd.secrets
转载于:https://blog.51cto.com/zhzhang/743531