<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[运维进行时]]></title> 
<link>https://blog.liuts.com/index.php</link> 
<description><![CDATA[互联网运维与架构]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[运维进行时]]></copyright>
<item>
<link>https://blog.liuts.com/post//</link>
<title><![CDATA[rsync安装文档]]></title> 
<author> &lt;&gt;</author>
<category><![CDATA[Linux]]></category>
<pubDate>Tue, 14 Aug 2007 16:39:58 +0000</pubDate> 
<guid>https://blog.liuts.com/post//</guid> 
<description>
<![CDATA[ 
	一、安装rsync<br/>#tar zxvf rsync-2.6.3.tar.gz<br/>#cd rsync-2.6.3<br/>#./configure<br/>#make<br/>#make install----------------------------服务器端-------------------------------<br/>#vi /etc/rsyncd.conf<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">uid = ftp<br/>gid = ftpusers<br/>use chroot = no<br/>max connections = 4<br/>pid file = /var/run/rsyncd.pid<br/>lock file = /var/run/rsync.lock<br/>log file = /var/log/rsyncd.log<br/>[www]<br/>path = /home/www/<br/>comment = Welcome to rsyncd host<br/>ignore errors<br/>read only = true<br/>list = false<br/>auth users = tiansi<br/>hosts allow = 220.174.234.56<br/>secrets file = /etc/rsyncd.secrets</div></div><br/>运行：<br/>#/usr/local/bin/rsync --daemon<br/>----------------------------请求端-------------------------------<br/>vi /etc/rsync.pass<br/>设置用户密码<br/>chmod 600 /etc/rsync.pass<br/>/usr/bin/rsync -vzrtopg --delete --progress tiansi@202.100.250.69::www /home/web/ --password-file=/etc/rsync.pass<br/>============================SSH结合rsync===============================<br/>服务端(可不安装rsync)：<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">useradd back<br/>su back<br/>cd /home/back<br/>if [ ! -d .ssh ]; then mkdir .ssh ; chmod 700 .ssh ; fi<br/>mv webback-rsync-key.pub .ssh/<br/>cd .ssh/<br/>if [ ! -f authorized_keys ]; then touch authorized_keys ; chmod 600 authorized_keys ; fi<br/>SSH1登录:cat webback-rsync-key.pub >> known_hosts<br/>if [ ! -f authorized_keys2 ]; then touch authorized_keys2 ; chmod 600 authorized_keys2 ; fi</div></div><br/>SSH2登录:ssh-keygen -X -f webback-rsync-key.pub >> authorized_keys2<br/>客户端：<br/>可用root帐号操作<br/>#ssh-keygen -t dsa -b 2048 -f /home/cron/webback-rsync-key #注意这里不需要输入passphrase<br/>#webback-rsync-key.pub上传到服务器端。<br/>#vi rsync.sh<br/><textarea name="code" class="python:nogutter" rows="15" cols="100">
#!/bin/sh
RSYNC-/usr/bin/rsync
SSH-/usr/bin/ssh
KEY-/home/back/webback-rsync-key
RUSER-back
RHOST-202.100.250.69
RPATH-/home/www
LPATH-/home/web
$RSYNC -avu -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH
</textarea><br/>#chmod +x rsync.sh<br/>0,30 * * * * /home/cron/rsync.sh<br/>Tags - <a href="https://blog.liuts.com/tags/rsync/" rel="tag">rsync</a>
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post//#blogcomment</link>
<title><![CDATA[[评论] rsync安装文档]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://blog.liuts.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>