rsync

Rsync工作原理----转

安稳与你 提交于 2019-12-26 14:08:13
Rsync工作原理 一 Rsync 1)软件简介 Rsync 是一个远程数据同步工具,可通过 LAN/WAN 快速同步多台主机间的文件。Rsync 本来是用以取代rcp 的一个工具,它当前由 Rsync.samba.org 维护。Rsync 使用所谓的“Rsync 演算法”来使本地和远程两个主机之间的文件达到同步,这个算法只传送两个文件的不同部分,而不是每次都整份传送,因此速度相当快。运行 Rsync server 的机器也叫 backup server,一个 Rsync server 可同时备份多个 client 的数据;也可以多个Rsync server 备份一个 client 的数据。 Rsync 可以搭配 rsh 或 ssh 甚至使用 daemon 模式。Rsync server 会打开一个873的服务通道(port),等待对方 Rsync 连接。连接时,Rsync server 会检查口令是否相符,若通过口令查核,则可以开始进行文件传输。第一次连通完成时,会把整份文件传输一次,下一次就只传送二个文件之间不同的部份。 Rsync 支持大多数的类 Unix 系统,无论是 Linux、Solaris 还是 BSD 上都经过了良好的测试。此外,它在windows 平台下也有相应的版本,比较知名的有 cwRsync 和 Sync2NAS。 Rsync 的基本特点如下:

rsync 服务器搭建遇到的问题

泪湿孤枕 提交于 2019-12-25 22:31:18
问题一: @ERROR: chroot failed rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 原因: 服务器端的目录不存在或无权限,创建目录并修正权限可解决问题。 问题二: @ERROR: auth failed on module tee rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 原因: 服务器端该模块(tee)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。 提供正确的用户名密码解决此问题。 问题三: @ERROR: Unknown module ‘tee_nonexists' rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 原因: 服务器不存在指定模块。提供正确的模块名或在服务器端修改成你要的模块以解决问题。 问题1: 在client上遇到问题: rsync -auzv --progress --password-file=/etc

rsync 远程同步

自作多情 提交于 2019-12-25 21:00:38
内容要点 一、rsync介绍 二、关于inotify 三、rsync配置实例 一、rsync介绍 1、关于rsync 一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SsH、rsync 主机同步 官方网站: http://rsync.samba.org 2、配置rsync源服务器 rsync同步源 指备份操作的远程服务器,也称为备份源 配置rsync源 基本思路 建立rsyncd.conf配置文件、独立的账号文件 启用rsync的-daemon模式 应用示例 用户backuper, 允许下行同步 操作的目录为/var/www/html/ 配置文件rsyncd.conf 需手动建立,语法类似于Samba配置 认证配置auth users、secrets file, 不加则为匿名 rsync账号文件 采用"用户名:密码”的记录格式,每行一个用户记录 独立的账号数据,不依赖于系统账号 启用rsync服务 通过--daemon独自提供服务 执行kill $(cat /var/run/rsyncd.pid)关闭rsync服务 3、使用rsync备份工具 rsync命令用法 rsync [选项] 原始位置 目标位置 常用选项 -a:归档模式,递归并保留对象属性,等同于-rlptgoD -v:示同步过程的详细(verbose)信息 -z:在传输文件时进行压缩

Local rsync inclusion/exclusion

℡╲_俬逩灬. 提交于 2019-12-25 14:49:46
问题 I can't seem to get the command to backup /etc/php5, /etc/apache2 and /etc/mysql right. I'm using two since I couldn't figure out how to do both in one. The first one works: rsync -vahtl --dry-run --log-file=$LOGFILE --exclude="wp-includes/" --exclude="wp-admin/" --exclude="wp-*.php" /var/www $DROPBOX_FOLDER But when I run the second, I tried a bunch of --include and --exclude directives variation and nothing works: rsync -vahtl --dry-run --log-file=$LOGFILE --include="php5" --exclude="*"

Local rsync inclusion/exclusion

戏子无情 提交于 2019-12-25 14:49:08
问题 I can't seem to get the command to backup /etc/php5, /etc/apache2 and /etc/mysql right. I'm using two since I couldn't figure out how to do both in one. The first one works: rsync -vahtl --dry-run --log-file=$LOGFILE --exclude="wp-includes/" --exclude="wp-admin/" --exclude="wp-*.php" /var/www $DROPBOX_FOLDER But when I run the second, I tried a bunch of --include and --exclude directives variation and nothing works: rsync -vahtl --dry-run --log-file=$LOGFILE --include="php5" --exclude="*"

Hotback of Git Server Using RSync?

安稳与你 提交于 2019-12-25 07:14:04
问题 I'm wondering if it is safe to use rsync to hotbackup a git server (The /home/git folder containing multiple repositories). I'm assuming that this could introduce race conditions, but perhaps git commit is an atomic operation such that rsync either sees the files as they are before the commit or after the commit but not somewhere inbetween. I'll provide an example as well just to make sure I'm illustrating this properly. Suppose file A and file B are being committed to one of the repositories

rsync远程同步(理论+实践篇)

我的梦境 提交于 2019-12-25 00:11:31
关于rsync 一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SsH、rsync 主机同步 官方网站: http://rsync.samba.org 配置rsync源服务器 rsync同步源 指备份操作的远程服务器,也称为备份源 配置rsync源 基本思路 建立rsyncd.conf配置文件、独立的账号文件 启用rsync的-daemon模式 应用示例 用户backuper, 允许下行同步 操作的目录为/var/www/html/ 配置文件rsyncd.conf 需手动建立,语法类似于Samba配置 认证配置auth users、secrets file, 不加则为匿名 rsync账号文件 采用"用户名:密码”的记录格式,每行一个用户记录 独立的账号数据,不依赖于系统账号 启用rsync服务 通过--daemon独自提供服务 执行kill $(cat /var/run/rsyncd.pid)关闭rsync服务 使用rsync备份工具 rsync命令用法 rsync [选项] 原始位置 目标位置 常用选项 -a:归档模式,递归并保留对象属性,等同于-rlptgoD -v:示同步过程的详细(verbose)信息 -z:在传输文件时进行压缩(compress) -H:保留硬连接文件 -A:保留ACL属性信息 --delete

How to solve the error of the rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.2]

被刻印的时光 ゝ 提交于 2019-12-24 18:51:14
问题 I'm using a command of rsync for making a new directory to save the images the command is "rsync -ave --rsync-path='mkdir -p " + path + " && rsync' " + filePath + " ubuntu@" + LocalhostIp + ":" + path but while running my code this command will gives me the error the error is Error: exit status 14: rsync: Failed to exec --rsync-path=mkdir: No such file or directory (2) rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.2] rsync: connection unexpectedly closed (0 bytes received

rsync远程同步(理论+实战)

与世无争的帅哥 提交于 2019-12-24 16:09:05
关于rsync 一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH、rsync主机同步 官方网站: http://rsync.samba.org 配置rsync源服务器 rsync同步源 指备份操作的远程服务器,也称为备份源 配置rsync源 基本思路 建立rsync.conf配置文件,独立的账号文件 启用rsync的--daemon模式 应用示例 用户backuper,允许下行同步 操作的目录为/var/www/html 配置文件rsyncd.conf 需手动建立,语法类似于Samba配置 认证配置auth users,secrets file,不加则为匿名 rsync账号文件 采用“用户名:密码”的记录格式,每行一个用户记录 独立的账号数据,不依赖于系统账号 启用rsync服务 通过--daemon独自提供服务 执行kill $(cat /var/run/rsync.pid)关闭rsync服务 使用rsync备份工具 rsync命令的用法 rsync [选项] 原始位置 目标位置 常用选项 -a:归档模式,递归并保留对象属性,等用于-rlptgoD -v:显示同步过程的详细信息 -z:在传输文件时进行压缩 -H:保留硬连接文件 -A:保留ACL属性信息 --delete:删除目标位置有而原始位置没有的文件 --checksum

Using rsync to sync only files that are modified

痴心易碎 提交于 2019-12-24 10:55:44
问题 I am trying to sync two folders /developer and /shared ( in ubuntu ) when I modify a file in /shared , I would like to be able to copy the file to the /developer folder I tried rsync -r /shared /developer But it seems to copy everything, although I changed only two files there. How to copy only the changed files. I also tried rsync -rtu /shared /developer somehow I can't get my head around this. Please help. 回答1: Try this: rsync -a /shared/ /developer/ The first time you run that it will