进入 /usr/ports/net/rsync
make install clean
两边服务器都安装上
创建密码文件:
/usr/local/etc/rsyncd.secrets 内容:
bind:12345678
// bind 是 本机的DNS 帐号,因为我这个应用主要针对 DNS同步。 密码随便写
然后
vi /usr/local/etc/rsyncd.conf
# rsyncd.conf - Example file, see rsyncd.conf(5) # # Set this if you want to stop rsync daemon with rc.d scripts pid file = /var/run/rsyncd.pid # Edit this file before running rsync daemon!! #uid = nobody #gid = nobody #use chroot = no #max connections = 4 #syslog facility = local5 #[ftp] # path = /var/ftp/pub # comment = whole ftp area (approx 6.1 GB) #[sambaftp] # path = /var/ftp/pub/samba # comment = Samba ftp area (approx 300 MB) #[rsyncftp] # path = /var/ftp/pub/rsync # comment = rsync ftp area (approx 6 MB) #[sambawww] # path = /public_html/samba # comment = Samba WWW pages (approx 240 MB) #[cvs] # path = /data/cvs # comment = CVS repository (requires authentication) # auth users = tridge, susan # secrets file = /usr/local/etc/rsyncd.secrets [dns] comment = dns zone rsync path = /etc/namedb/dnsarea uid = bind gid = bind secrets file = /usr/local/etc/rsyncd.secrets read only = no
rsync 的服务端配置好了。现在开始配置 客户端 推送方
vi /usr/local/etc/rsyncd.secrets
然后输入 和服务端一样的密码: 12345678
然后就OK了。开始推送同步:
/usr/local/bin/rsync -avzP --password-file=/usr/local/etc/rsyncd.secrets /etc/namedb/dnsarea/ 192.168.1.241::dns