个人工具
119.28.94.63
该IP地址的讨论
登录
查看“UbuntuHelp:Rsync”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Rsync”的源代码
来自Ubuntu中文
←
UbuntuHelp:Rsync
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/rsync}} {{Languages|UbuntuHelp:rsync}} == Introduction == '''rsync''' is a program that copies file from one location to another, with it you can make '''backups''' of your files, '''synchronize''' data on different locations and computers. It is commonly used by unix users to keep a safe backup of their files and is often recommended as the simplest solution for backups and safety copys. Other software for backup is listed on [[UbuntuHelp:BackupYourSystem|BackupYourSystem]]. Rsync minimizes 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. This document is a rsync quick howto. == Installation == rsync is usually installed on ubuntu. In the rare case when it is not on your system, do the following step to install rsync: <pre><nowiki> $ sudo apt-get install rsync xinetd </nowiki></pre> == Using RSYNC with SSH for a simple backup == (This example is also given on [[UbuntuHelp:BackupYourSystem|BackupYourSystem]]) Rsync updates the copies the files that have changed and even then only transfers the parts of those files that have changed. That is useful for saving bandwidth when backing up over the network. Rsync is especially good for backing up home directories. For safety, transfer between two machines is done via SSH. Also, SSH is installed on most unix machines, so this method will be easier for you to use. The command for transferring to a remote machine is: <pre><nowiki> sudo rsync --delete -azvv -e ssh /home remoteuser@remotehost.remotedomain:./backupdirectory </nowiki></pre> <code><nowiki>-z</nowiki></code> compresses the data <code><nowiki>--delete</nowiki></code> deletes files that don't exist on the system being backed up. Maybe you want this, maybe not. <code><nowiki>-a</nowiki></code> preserves the date and times of the files (same as <code><nowiki>-t</nowiki></code>), descends recursively into all directories (same as <code><nowiki>-r</nowiki></code>), copies symlinks as symlinks (same as <code><nowiki>-l</nowiki></code>), preserves file permissions (same as <code><nowiki>-p</nowiki></code>), preserves groups (same as <code><nowiki>-g</nowiki></code>), preserves file ownership (same as <code><nowiki>-o</nowiki></code>), and preserves devices as devices (same as <code><nowiki>-D</nowiki></code>). <code><nowiki>-vv</nowiki></code> increases the verbosity of the reporting process rsync has several [http://www.debianadmin.com/rsync-backup-web-interfacefrontend-or-gui-tools.html graphical frontends: grsync, Backup Monitor, QSync, Zynk, rsyncbackup, TKsync] == Configuration of the RSYNC daemon == You need the rsync daemon when you want to synchronize two computers and the simple way using SSH doesn't work for you. Using the daemon is usually more complicated than just using rsync with an ssh connection. 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> $ 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 } </nowiki></pre> 3. Create ''/etc/rsyncd.conf'' configuration for rsync in daemon mode. <pre><nowiki> $ 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 </nowiki></pre> 4. Create ''/etc/rsyncd.secrets'' for user's password. <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 <pre><nowiki> $ sudo /etc/init.d/xinetd restart </nowiki></pre> == Testing == Run the following command to check if everything is ok. <pre><nowiki> $ sudo rsync user@192.168.0.1::share Password: drwxr-xr-x 4096 2006/12/13 09:41:59 . drwxr-xr-x 4096 2006/11/23 18:00:03 folders </nowiki></pre> ---- [[category:CategoryDocumentation]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Rsync
。