rsync同步可以,但是在日志里会有错误
服务器端IP 192.168.108.202
rsyncd.conf 的配置
motd file = /etc/rsyncd.motd
read only = yes
list = yes
uid = root
gid = root
hosts allow = 192.168.108.201
#hosts deny = 192.168.0.0/16
max connections = 5
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
[webroot]
comment = rsync 's directory from 192.168.108.202
path = /database/webroot
auth users = rsync
read only = yes
secrets file = /etc/rsyncd.secret
[mysql]
comment = rsync 's directory from 192.168.108.202
path = /database/mysql
read only = yes
auth users = rsync
secrets file = /etc/rsyncd.secret
rsyncd.secret的配置
rsync:123456
chmod 600 rsyncd.secret
启动:
rsync --daemon --config=/etc/rsyncd.conf
客户端IP192.168.108.201
rsyncd.secret配置
123456
chmod 600 rsyncd.secret
写了一个脚本 202to201.sh
#!/bin/bash
/usr/bin/rsync -vau --delete --progress [email=rsync@192.168.108.202::webroot]rsync@192.168.108.202::webroot[/email] /database/webroot --password-file=/etc/rsyncd.secret
/usr/bin/rsync -vau --delete --progress [email=rsync@192.168.108.202::mysql]rsync@192.168.108.202::mysql[/email] /database/mysql --password-file=/etc/rsyncd.secret
chmod 755 202to201.sh
crontab -e
* * * * * /root/202to201.sh
配置就这些了,运行也行可是我看服务端的日志的会出现下面的提示:
2007/12/13 18:46:00 [8186] rsync: name lookup failed for 192.168.108.201: Name or service not known
2007/12/13 18:46:00 [8186] rsync on webroot from [email=rsync@unknown]rsync@unknown[/email] (192.168.108.201)
2007/12/13 18:46:01 [8186] wrote 58899 bytes read 110 bytes total size 32769660
2007/12/13 18:46:01 [8187] rsync: name lookup failed for 192.168.108.201: Name or service not known
2007/12/13 18:46:01 [8187] rsync on mysql from unknown (192.168.108.201)
2007/12/13 18:46:01 [8187] wrote 3969 bytes read 77 bytes total size 24169404
请问这是什么问题呢?