rsync

In Python, how to write a string to a file on a remote machine?

泄露秘密 提交于 2019-12-18 03:40:18
问题 On Machine1, I have a Python2.7 script that computes a big (up to 10MB) binary string in RAM that I'd like to write to a disk file on Machine2, which is a remote machine. What is the best way to do this? Constraints: Both machines are Ubuntu 13.04. The connection between them is fast -- they are on the same network. The destination directory might not yet exist on Machine2, so it might need to be created. If it's easy, I would like to avoid writing the string from RAM to a temporary disk file

日常运维--rsync同步工具

时光怂恿深爱的人放手 提交于 2019-12-17 21:40:19
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> rsync命令 是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件。rsync使用所谓的“rsync算法”来使本地和远程两个主机之间的文件达到同步,这个算法只传送两个文件的不同部分,而不是每次都整份传送,因此速度相当快。 rsync功能 作为命令,实现本地-远程文件同步 作为服务,实现本地-远程文件同步 rsync特点 可以镜像保存整个目录树和文件系统 可以保留原有的权限(permission,mode),owner,group,时间(修改时间,modify time),软硬链接,文件acl,文件属性(attributes)信息等 传输效率高,使用同步算法,只比较变化的 支持匿名传输,方便网站镜像;也可以做验证,加强安全 rsync同类服务 sync 同步:刷新文件系统缓存,强制将修改过的数据块写入磁盘,并且更新超级块。 async 异步:将数据先放到缓冲区,再周期性(一般是30s)的去同步到磁盘。 rsync 远程同步:remote synchronous rsync -av /etc/passwd /tmp/1.txt rsync -av /tmp/1.txt 192.168.36.131:/tmp/2.txt rsync -av /tmp/1.txt 192.168.188.128:

Day35 rsync通过服务同步

折月煮酒 提交于 2019-12-17 21:35:41
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> rsync通过服务同步 rsyncd.conf配置文件详解 port:指定在哪个端口启动rsyncd服务,默认是873端口。 log file:指定日志文件。 pid file:指定pid文件,这个文件的作用涉及服务的启动、停止等进程管理操作。 address:指定启动rsyncd服务的IP。假如你的机器有多个IP,就可以指定由其中一个启动rsyncd服务,如果不指定该参数,默认是在全部IP上启动。 []:指定模块名,里面内容自定义。 path:指定数据存放的路径。 use chroot true|false:表示在传输文件前首先chroot到path参数所指定的目录下。这样做的原因是实现额外的安全防护,但缺点是需要以roots权限,并且不能备份指向外部的符号连接所指向的目录文件。默认情况下chroot值为true,如果你的数据当中有软连接文件,阿铭建议你设置成false。 rsyncd.conf配置文件详解 port:指定在哪个端口启动 rsyncd服务,默认是873端口。 log file:指定日志文件。 pid file:指定pid文件,这个文件的作用涉及服务的启动、停止等进程管理操作 。 address:指定启动rsyncd服务的IP。假如你的机器有多个IP,就可以指定由其中一个启动rsyncd服务

What does f+++++++++ mean in rsync logs?

倖福魔咒の 提交于 2019-12-17 21:24:13
问题 I'm using rsync to make a backup of my server files, and I have two questions: In the middle of the process I need to stop and start rsync again. Will rsync start from the point where it stopped or it will restart from the beginning? In the log files I see "f+++++++++" . What does it mean? e.g.: 2010/12/21 08:28:37 [4537] >f.st...... iddd/logs/website-production-access_log 2010/12/21 08:29:11 [4537] >f.st...... iddd/web/website/production/shared/log/production.log 2010/12/21 08:29:14 [4537]

rsync远程同步

南楼画角 提交于 2019-12-17 19:07:10
rsync远程同步 rsync 一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH、rsync主机同步 官方网站: httop://rsync.samba.org 配置rsync源 [root@localhost ~]# rpm -q rsync //查看rsync软件包是否存在 基本思路 建立rsyncd.conf配置文件、独立的账号文件 启用rsync的--daemon模式 配置文件rsyncd.conf 需要手动建立、语法类似于Samba配置 认证配置auth users、secrets file,不加则为匿名 配置rsync源服务器 [root@localhost ~]# vim /etc/rsyncd.conf uid = nobody gid = nobody //匿名用户 use chroot = yes //禁止进入家目录 address = 192.168.45.133 port 873 log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid hosts allow = 192.168.45.0/24 dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 [wwwroot] path = /var

rsync: how can I configure it to create target directory on server?

…衆ロ難τιáo~ 提交于 2019-12-17 10:22:47
问题 I would like to rsync from local computer to server. On a directory that does not exist, and I want rsync to create that directory on the server first. How can I do that? 回答1: If you have more than the last leaf directory to be created, you can either run a separate ssh ... mkdir -p first, or use the --rsync-path trick as explained here : rsync -a --rsync-path="mkdir -p /tmp/x/y/z/ && rsync" $source user@remote:/tmp/x/y/z/ Or use the --relative option as suggested by Tony. In that case, you

rsync 守护进程daemon

假如想象 提交于 2019-12-17 06:57:10
服务端配置:rsync的配置文件是/etc/rsyncd.conf。注意这个文件默认是不存在的,需要手动创建。 下面是一个配置好的rsyncd.conf ######rsyncd.conf####### uid = rsync ----à非系统虚拟用户 gid = rsync use chroot =no -à防止出现安全问题 maxconnections = 200 --à最大连接数 timeout = 300 --à超时时间 pid file =/var/run/rsyncd.pid --à进程pid所在的文件 lock file =/var/run/rsync.lock -à锁 log file =/var/log/rsyncd.log -à出错的日志文件 [zhaofan] --à模块 path = /zhaofan/ à可以理解为共享目录 ignore errors --à忽略错误 read only =false list = false -à是否允许列表 hosts allow =192.168.1.0/24 --à允许的主机 hosts deny =0.0.0.0/32 auth users =rsync_backup -à虚拟用户 secrets file= /etc/rsync.password -à用户对应的密码文件 #######rsyncd.config#

rsync远程同步——(实战!)

ⅰ亾dé卋堺 提交于 2019-12-16 12:41:48
关于rsync 一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH,rsync主机同步 配置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:根据对象的校验和来决定是否跳过文件 配置源的两种表示方法 格式1:用户名

Rsync搭建部署和配置文件详解

你。 提交于 2019-12-16 12:32:05
环境: Centos 7 [root@localhost ~]# uname -a Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux ip: 192.168.192.129 rsync服务端 ip :192.168.192.137 rsync客户端 0.先把客户端和服务端的防火墙和selinux关了 systemctl stop firewalld setenforce 0 1.服务端安装采用编译安装 cd /usr/local/src mkdir rsync cd rsync yum install gcc gcc-devel -y wget https://download.samba.org/pub/rsync/src/rsync-3.1.3.tar.gz tar -zxf rsync-3.1.3.tar.gz cd rsync-3.1.3 ./configure --prefix=/usr/local/rsync make && make install PATH="/usr/local/rsync/bin/:$PATH" 2.服务端编写配置文件/etc/rsyncd.conf

rsync-----远程同步

吃可爱长大的小学妹 提交于 2019-12-16 10:02:19
一、rsync同步简介 (1)、Remote Sync ----- 远程同步,支持本地复制,或者与其他SSH 、rsync主机同步,功能类似于scp,但是要比scp丰富。 (2)、特点 1、可以镜像保存整个目录树和文件系统。 2、可以很容易做到保持原来文件的权限、时间、软硬链接等等,无须特殊权限即可安装。 3、快速:第一次同步时 rsync 会复制全部内容,但在下一次只传输修改过的文件。rsync 在传输数据的过程中可以实行压缩及解压缩操作,因此可以使用更少的带宽。 4、安全:可以使用scp、ssh等方式来传输文件,当然也可以通过直接的socket连接。 支持匿名传输,以方便进行网站镜像。 二、rsync命令的用法 rsync [ 选项 ] 原始位置 目标位置 常用选项 - a : 归档模式,递归并保留对象属性,等同于 - rlptgoD - v : 显示同步过程的详细信息 - z : 在传输文件时进行压缩 - H : 保留硬链接文件 - A : 保留 ACL属性信息 -- delete :删除目标位置有,而原始位置没有的文件 -- checksum :根据对象的校验和来决定是否跳过文件 格式1 :用户名@主机地址::共享模块名 格式2: :rsync: / / 用户名@主机地址 / 共享模块名 rsync源的免交互处理: 使用 -- password - file=密码文件 三