rsync同步可以,但是在日志里会有错误
服务器端IP 192.168.108.202rsyncd.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
comment = rsync 's directory from 192.168.108.202
path = /database/webroot
auth users = rsync
read only = yes
secrets file = /etc/rsyncd.secret
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 protected]::webroot /database/webroot --password-file=/etc/rsyncd.secret
/usr/bin/rsync -vau --delete --progress [email protected]::mysql /database/mysql --password-file=/etc/rsyncd.secret
chmod 755 202to201.sh
crontab -e
* * * * * /root/202to201.sh
配置就这些了,运行也行可是我看服务端的日志的会出现下面的提示:
2007/12/13 18:46:00 rsync: name lookup failed for 192.168.108.201: Name or service not known
2007/12/13 18:46:00 rsync on webroot from rsync@unknown (192.168.108.201)
2007/12/13 18:46:01 wrote 58899 bytesread 110 bytestotal size 32769660
2007/12/13 18:46:01 rsync: name lookup failed for 192.168.108.201: Name or service not known
2007/12/13 18:46:01 rsync on mysql from unknown (192.168.108.201)
2007/12/13 18:46:01 wrote 3969 bytesread 77 bytestotal size 24169404
请问这是什么问题呢?
[ 本帖最后由 xueleixu 于 2007-12-14 09:28 编辑 ] 没人指教,我就自己解决了,问题是在需要在服务端这台机上上的/etc/hosts里面添加客户端机的ip和机器名,如果有配DNS的话,那就不会有这样的问题了。
问题解决了,真开心!!!:-D
页:
[1]