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
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
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对网站进行镜像备份

asp程序改写为php的一些问题和记录
linux小知识点记录

