个人工具

“UbuntuHelp:Rsync”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/rsync}}
 
{{From|https://help.ubuntu.com/community/rsync}}
 
{{Languages|UbuntuHelp:rsync}}
 
{{Languages|UbuntuHelp:rsync}}
== 简介  ==
+
{{Translator|木饭}}
  
RSYNC的简单配置
+
== Note ==
 +
'''This page lacks explanation and doesn't explain what the user can do with rsync. It needs revision to be useful.'''
 +
== Introduction ==
 +
'''rsync''' is  a program that synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction.
 +
rsync can copy or display directory contents and copy files, optionally using compression and recursion.
 +
This document is a rsync quick howto.
 +
== Installation ==
 +
To install rsync do the following steps:
 +
<pre><nowiki>
 +
$ sudo apt-get install rsync xinetd
 +
</nowiki></pre>
 +
== Configuration ==
 +
1. Edit ''/etc/default/rsync'' to start rsync as daemon using xinetd.
  
== 导言  ==
+
<pre><nowiki>
 +
$ sudo vim /etc/default/rsync
 +
  RSYNC_ENABLE=inetd
 +
</nowiki></pre>
 +
2. Create ''/etc/xinetd.d/rsync'' to launch rsync via xinetd.
  
 
+
<pre><nowiki>
rsync是类unix系统下的数据镜像备份工具,从软件的命名上就可以看出来了——remote sync。它的特性如下:<br>可以镜像保存整个目录树和文件系统。<br>可以很容易做到保持原来文件的权限、时间、软硬链接等等。<br>无须特殊权限即可安装。<br>优化的流程,文件传输效率高。<br>可以使用rcp、ssh等方式来传输文件,当然也可以通过直接的socket连接。<br>支持匿名传输,以方便进行网站镜象。<br>软件下载<br>rysnc的主页地址为:<br>http://rsync.samba.org/
+
$ sudo vim /etc/xinetd.d/rsync
 
+
<br>
+
 
+
== 安装  ==
+
 
+
在UBUNTU下安装RSYNC通过以下步骤可以实现:
+
<pre>$ sudo apt-get install rsync xinetd
+
</pre>
+
 
+
== 配置  ==
+
 
+
1. 编辑/etc/default/rsync 启动rsync作为使用xinetd的守护进程
+
<pre>$ sudo vim /etc/default/rsync
+
  RSYNC_ENABLE=inetd
+
</pre>
+
2. 创建 /etc/xinetd.d/rsync 通过xinetd使rsync开始工作<br>
+
<pre>$ sudo vim /etc/xinetd.d/rsync
+
 
   service rsync
 
   service rsync
 
     {
 
     {
第37行: 第36行:
 
     }
 
     }
  
</pre>  
+
</nowiki></pre>
3. 创建 ''/etc/rsyncd.conf''&nbsp; 配置rsync使其在.  
+
3. Create ''/etc/rsyncd.conf'' configuration for rsync in daemon mode.
<pre>$ sudo vim /etc/rsyncd.conf
+
 
 +
<pre><nowiki>
 +
$ sudo vim /etc/rsyncd.conf
 
   max connections = 2
 
   max connections = 2
 
   log file = /var/log/rsync.log
 
   log file = /var/log/rsync.log
第53行: 第54行:
 
   auth users = user
 
   auth users = user
 
   secrets file = /etc/rsyncd.secrets
 
   secrets file = /etc/rsyncd.secrets
</pre>  
+
</nowiki></pre>
4. 创建 ''/etc/rsyncd.secrets''&nbsp; 配置用户名和密码.
+
4. Create ''/etc/rsyncd.secrets'' for user's password.
<pre>$ sudo vim /etc/rsyncd.secrets
+
  user:password
+
</pre>
+
4.a
+
<pre>$ sudo chmod 600 /etc/rsyncd.secrets
+
</pre>
+
5. 启动/重启 xinetd
+
<pre>$ sudo /etc/init.d/xinetd restart
+
</pre>
+
  
== 测试  ==
+
<pre><nowiki>
 +
$ sudo vim /etc/rsyncd.secrets
 +
  user:password
 +
</nowiki></pre>
 +
4.a
 +
<pre><nowiki>
 +
$ sudo chmod 600 /etc/rsyncd.secrets
 +
</nowiki></pre>
 +
5. Start/Restart xinetd
  
运行下面的命令检查,确认rsync配置成功。
+
<pre><nowiki>
<pre>$ sudo rsync [email protected]::share
+
$ sudo /etc/init.d/xinetd restart
 +
</nowiki></pre>
 +
== Testing ==
 +
Run the following command to check if everything is ok.
 +
<pre><nowiki>
 +
$ sudo rsync [email protected]::share
 
   Password:  
 
   Password:  
 
   drwxr-xr-x        4096 2006/12/13 09:41:59 .
 
   drwxr-xr-x        4096 2006/12/13 09:41:59 .
 
   drwxr-xr-x        4096 2006/11/23 18:00:03 folders
 
   drwxr-xr-x        4096 2006/11/23 18:00:03 folders
</pre>  
+
</nowiki></pre>
 
----
 
----
 +
[[category:CategoryDocumentation]]
  
[[Category:CategoryDocumentation|UbuntuHelp:Rsync]] [[Category:UbuntuHelp|UbuntuHelp:Rsync]]
+
[[category:UbuntuHelp]]

2008年8月4日 (一) 16:39的版本


Note

This page lacks explanation and doesn't explain what the user can do with rsync. It needs revision to be useful.

Introduction

rsync is a program that synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion. This document is a rsync quick howto.

Installation

To install rsync do the following steps:

$ sudo apt-get install rsync xinetd

Configuration

1. Edit /etc/default/rsync to start rsync as daemon using xinetd.

$ sudo vim /etc/default/rsync
  RSYNC_ENABLE=inetd

2. Create /etc/xinetd.d/rsync to launch rsync via xinetd.

$ sudo vim /etc/xinetd.d/rsync
  service rsync
    {
        disable         = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
    }

3. Create /etc/rsyncd.conf configuration for rsync in daemon mode.

$ sudo vim /etc/rsyncd.conf
  max connections = 2
  log file = /var/log/rsync.log
  timeout = 300

  [share]
  comment = Public Share
  path = /home/share
  read only = no
  list = yes
  uid = nobody
  gid = nogroup
  auth users = user
  secrets file = /etc/rsyncd.secrets

4. Create /etc/rsyncd.secrets for user's password.

$ sudo vim /etc/rsyncd.secrets 
  user:password

4.a

$ sudo chmod 600 /etc/rsyncd.secrets

5. Start/Restart xinetd

$ sudo /etc/init.d/xinetd restart

Testing

Run the following command to check if everything is ok.

$ sudo rsync [email protected]::share
  Password: 
  drwxr-xr-x        4096 2006/12/13 09:41:59 .
  drwxr-xr-x        4096 2006/11/23 18:00:03 folders