百度首页 | 百度空间
 
查看文章
 
如果实现网站同步
2008-07-16 13:25

作者:YOUDI(Kevin.U)

安装:

Wget http://samba.anu.edu.au/ftp/rsync/rsync-3.0.3.tar.gz

tar zxvf rsync-3.0.3.tar.gz

cd rsync-3.0.3

./configure

make

make install

设置:

vim rc.local

加入

/usr/bin/rsync --daemon --config=/etc/rsyncd.conf

vi /etc/rsyncd.conf

uid = root

gid = root

max connections = 4

port = 888

hosts allow = 允许主机列表,ip,ip

#hosts deny = 0.0.0.0/32

[项目名称]

path=项目路径

comment = 备注

read only = yes

auth users = sms,test 允许客户端哪些用户执行

strict modes = false

secrets file = /etc/rsyncd.secrets 认证文件.

rsyncd.secrets

//客户端认证文件

sms:xxxxxxxxxxxxxxxx

test:xxxxxxxxxxxxxxxxx

用户名:密码

客户端执行同步:

rsync --port=888 -vzrtp --progress --delete --password-file=/www/scripts/rsync.passwd sms@office.digilinx.cn::cuc /www/cuc/

rsync –port=端口

vverbosez是压缩,rrecursivetopg都是保持文件原有属性如属主、时间的参数。--progress是指显示出详细的进度情况,--delete是指如果服务器端删除了这一文件,那么客户端也相应把文件删除,保持真正的一致

用户@主机名::模块名 路径

rsync.passwd

rsyncd.secrets 客户端认证文件

中的密码

: xxxxxxxxxxxxxxxxx


类别:Open Source | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码:
 

     

©2008 Baidu