Rsync

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(安装指南)
 
(未显示3个用户的17个中间版本)
第1行: 第1行:
http://rsync.samba.org/
+
{{SeeWikipedia}}
  
 +
http://rsync.samba.org/
 
==安装指南==
 
==安装指南==
 
*[[Rsync Over SSH Configuration in Debian]]
 
*[[Rsync Over SSH Configuration in Debian]]
 +
*[[Rsync Configuration]]
  
获得源码: http://rsync.samba.org/ftp/rsync/rsync-2.6.8.tar.gz
+
获得源码: http://rsync.samba.org/ftp/rsync
 
  tar zxvf rsync-2.6.8.tar.gz
 
  tar zxvf rsync-2.6.8.tar.gz
 
  cd rsync-2.6.8, as root
 
  cd rsync-2.6.8, as root
第17行: 第19行:
 
and in /etc/inetd.conf add:
 
and in /etc/inetd.conf add:
 
  rsync stream tcp nowait root /usr/bin/rsync rsync --daemon --config=/etc/rsyncd.conf
 
  rsync stream tcp nowait root /usr/bin/rsync rsync --daemon --config=/etc/rsyncd.conf
 +
 +
/etc/rsyncd.conf
 +
uid = nobody
 +
gid = nobody
 +
use chroot = no
 +
max connections = 4
 +
pid file = /var/run/rsyncd.pid
 +
lock file = /var/run/rsync.lock
 +
log file = /var/log/rsyncd.log
 +
 +
[www]
 +
path = /home/www/
 +
comment = huihoo rsync site
 +
ignore errors
 +
read only = true
 +
list = false
 +
auth users = backup
 +
hosts allow = 192.168.1.2/32
 +
secrets file = /etc/rsyncd.secrets
 +
 +
server运行 # rsync --daemon
 +
 +
client运行  rsync -avz -e ssh backup192.168.1.3::www /home/backup/www
 +
rsync -avz /var/www [email protected]://home/www
 +
or $ rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/ 要改端口的加上 -e 'ssh -p 2002'
 +
 +
protocol version mismatch - is your shell clean?
 +
(see the rsync man page for an explanation)
 +
rsync error: protocol incompatibility (code 2) at compat.c(69)
 +
 +
或从服务器端发起镜像操作
 +
rsync -vazu -e ssh ./* [email protected]:/home/www
 +
将当前目录下的所有文件通过ssh协议传送到远程服务器的/home/www目录中。
 +
 +
另外scp 也能完成此操作
 +
scp -p ./* [email protected]:/home/www
 +
将当前目录下的所有文件通过scp工具传送到远程服务器的/home/www目录中。
  
 
==相关文档==
 
==相关文档==
 +
*[http://www.jdmz.net/ssh/ Using Rsync and SSH]
 
*[[Rsync_Mirror_Site|用rsync对网站进行镜像备份]]
 
*[[Rsync_Mirror_Site|用rsync对网站进行镜像备份]]
 
*rsync examples - http://rsync.samba.org/examples.html
 
*rsync examples - http://rsync.samba.org/examples.html
 +
*[http://www.netadmin.com.cn/kt_article_show.php?article_id=1379&categ_code=10031004 Rsync同步镜像服务的搭建]
 +
 +
{{Comment}}
 +
 +
[[Category:Storage]]

2012年7月20日 (五) 08:09的最后版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Rsync Thanks, Wikipedia.

http://rsync.samba.org/

[编辑] 安装指南

获得源码: http://rsync.samba.org/ftp/rsync

tar zxvf rsync-2.6.8.tar.gz
cd rsync-2.6.8, as root
./configure
make
make install
rsync --help 

You can simply run rsync as a daemon, or you can have it started automatically by inetd. In /etc/services add:

rsync 873/tcp

and in /etc/inetd.conf add:

rsync stream tcp nowait root /usr/bin/rsync rsync --daemon --config=/etc/rsyncd.conf

/etc/rsyncd.conf

uid = nobody
gid = nobody
use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[www]
path = /home/www/
comment = huihoo rsync site
ignore errors
read only = true
list = false
auth users = backup
hosts allow = 192.168.1.2/32
secrets file = /etc/rsyncd.secrets

server运行 # rsync --daemon

client运行 rsync -avz -e ssh backup192.168.1.3::www /home/backup/www

rsync -avz /var/www [email protected]://home/www
or $ rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/ 要改端口的加上 -e 'ssh -p 2002'
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(69)

或从服务器端发起镜像操作

rsync -vazu -e ssh ./* [email protected]:/home/www

将当前目录下的所有文件通过ssh协议传送到远程服务器的/home/www目录中。

另外scp 也能完成此操作

scp -p ./* [email protected]:/home/www

将当前目录下的所有文件通过scp工具传送到远程服务器的/home/www目录中。

[编辑] 相关文档

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱