分享、学习、提高
2009/05/15 18:09
文章作者:Enjoy 转载请注明原文链接。
编辑要同步的服务器的/etc/rsyncd.conf
引用
uid = root
gid = root
use chroot = no
max connections = 5
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log

[9enjoy_com]
path = /www/9enjoy.com/
ignore errors
read only = true
hosts allow = 192.168.1.212

ps -auxf | grep rsync
找到rsync的进程,kill掉
然后启动它:/usr/bin/rsync --daemon
引用
[root@]# ps -auxf | grep rsync
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root     18219  0.0  0.0  5548  684 pts/0    S+   17:37   0:00                      \_ grep rsync
root      9895  0.0  0.0  2936  396 ?        Ss   Mar06   0:00 /usr/bin/rsync --daemon
[root@]# kill 9895
[root@]# /usr/bin/rsync --daemon


接着就可以在要同步到的服务器上运行
/usr/bin/rsync -auv rsync://192.168.1.200/9enjoy_com(同步名称) /www/9enjoy.com(本地目录)

补充:如果要排除某一目录,可以用--exclude="directory/"来排除。
如:/usr/bin/rsync --exclude="directory/" -auv rsync://192.168.1.200/9enjoy_com(同步名称) /www/9enjoy.com(本地目录)


参考阅读:
rsyncd.conf 教程
用rsync对网站进行镜像备份
发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]