“UbuntuHelp:Rsync”的版本间的差异
来自Ubuntu中文
小 (新页面: {{From|https://help.ubuntu.com/community/rsync}} {{Languages|UbuntuHelp:rsync}} == Note == '''This page lacks explanation and doesn't explain what the user can do with rsync. It needs re...) |
小 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/rsync}} | {{From|https://help.ubuntu.com/community/rsync}} | ||
{{Languages|UbuntuHelp:rsync}} | {{Languages|UbuntuHelp:rsync}} | ||
− | |||
== Note == | == Note == | ||
'''This page lacks explanation and doesn't explain what the user can do with rsync. It needs revision to be useful.''' | '''This page lacks explanation and doesn't explain what the user can do with rsync. It needs revision to be useful.''' | ||
− | |||
== Introduction == | == 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''' 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. | rsync can copy or display directory contents and copy files, optionally using compression and recursion. | ||
− | |||
This document is a rsync quick howto. | This document is a rsync quick howto. | ||
− | |||
== Installation == | == Installation == | ||
To install rsync do the following steps: | To install rsync do the following steps: | ||
第17行: | 第12行: | ||
$ sudo apt-get install rsync xinetd | $ sudo apt-get install rsync xinetd | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
== Configuration == | == Configuration == | ||
1. Edit ''/etc/default/rsync'' to start rsync as daemon using xinetd. | 1. Edit ''/etc/default/rsync'' to start rsync as daemon using xinetd. | ||
第24行: | 第18行: | ||
RSYNC_ENABLE=inetd | RSYNC_ENABLE=inetd | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
2. Create ''/etc/xinetd.d/rsync'' to launch rsync via xinetd. | 2. Create ''/etc/xinetd.d/rsync'' to launch rsync via xinetd. | ||
<pre><nowiki> | <pre><nowiki> | ||
第38行: | 第31行: | ||
log_on_failure += USERID | log_on_failure += USERID | ||
} | } | ||
− | |||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
2. Create ''/etc/rsyncd.conf'' configuration for rsync in daemon mode. | 2. Create ''/etc/rsyncd.conf'' configuration for rsync in daemon mode. | ||
<pre><nowiki> | <pre><nowiki> | ||
第47行: | 第38行: | ||
log file = /var/log/rsync.log | log file = /var/log/rsync.log | ||
timeout = 300 | timeout = 300 | ||
− | |||
[share] | [share] | ||
comment = Public Share | comment = Public Share | ||
第58行: | 第48行: | ||
secrets file = /etc/rsyncd.secrets | secrets file = /etc/rsyncd.secrets | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
3. Create ''/etc/rsyncd.secrets'' for user's password. | 3. Create ''/etc/rsyncd.secrets'' for user's password. | ||
<pre><nowiki> | <pre><nowiki> | ||
第64行: | 第53行: | ||
user:password | user:password | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
4. Start/Restart xinetd | 4. Start/Restart xinetd | ||
<pre><nowiki> | <pre><nowiki> | ||
$ sudo /etc/init.d/xinetd restart | $ sudo /etc/init.d/xinetd restart | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
== Testing == | == Testing == | ||
Run the following command to check if everything is ok. | Run the following command to check if everything is ok. | ||
第78行: | 第65行: | ||
drwxr-xr-x 4096 2006/11/23 18:00:03 folders | drwxr-xr-x 4096 2006/11/23 18:00:03 folders | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
---- | ---- | ||
[[category:CategoryDocumentation]] | [[category:CategoryDocumentation]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年11月30日 (五) 21:21的版本
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 }
2. 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
3. Create /etc/rsyncd.secrets for user's password.
$ sudo vim /etc/rsyncd.secrets user:password
4. 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