安装及配置

yum -y install rsync
#启动rsync服务
systemctl start rsyncd.service
systemctl enable rsyncd.service #检查是否已经成功启动
netstat -lnp|grep 873

服务端配置

# /etc/rsyncd: configuration file for rsync daemon mode

# See rsyncd.conf man page for more options.

# configuration example:

uid = root
gid = root
port = 873
use chroot = no
# read only = no
# list = no
max connections = 4
# pid file = /var/run/rsyncd.pid
exclude = lost+found/
transfer logging = yes
timeout = 900
motd file = /etc/rsyncd/rsyncd.motd
log file = /var/log/rsyncd.log
lock file = /var/run/rsyncd.lock
ignore nonreadable = yes
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 [simba]
path = /root/************/
comment=simba
ignore errors
read only = no
write only = no
list = no
auth users = root
secrets file = /etc/rsyncd.pass
hosts allow = *

给rsync定义身份,如下:

echo 'root:123456'>/etc/rsyncd.passwd   //文件用户名和路径为上面定义,别写错,密码自己定
chmod 600 /etc/rsyncd.passwd //修改权限

重启服务

systemctl restart rsyncd.service

客户端配置

创建密码

echo '' >>/etc/rsyncd-test.passwd     //注意这里只需要服务器rsyncd.passwd 中的密码
chmod 600 /etc/rsyncd-test.passwd

同步

rsync -auv --password-file=/etc/rsyncd-test.passwd  /root/*********/ root@120.x.x.x::simba

centos7安装rsync及两台机器进行文件同步的更多相关文章

  1. 两台Linux服务器文件同步

    在给公司或者学校做系统部署的时候,为了数据安全往往我们至少需要两台服务器,接下来请看: 我们要实现的是把客户端(192.168.0.1)的复制到目标服务器(192.168.0.2) 一.目标服务器 1 ...

  2. ROS知识(11)----同步两台机器时钟

    两台机器同时运行过程中,对于ROS的tf变换,其要求两台机器的时钟要保持一致. 1.查询时间 首先通过以下命令,看两台机器时钟是否有差异.在本机上,查看远程master的机器时间: ntpdate - ...

  3. rsync配置两台服务器之间的文件备份(同步)

    rsync配置两台服务器之间的文件备份(同步) 前情提要 环境: 192.168.1.2 主服务器 centos 7.7 192.168.1.3 备份服务器 centos 7.7 rsync 安装(两 ...

  4. Linux下 两台机器文件/文件夹 相互拷贝

    Linux下 两台机器文件/文件夹 相互拷贝 设有两台机器 :A:*.101及 B:*.102. 把A下的.temp/var/a.txt拷贝到B机器的/text/目录下: 进入B机器:scp root ...

  5. [synergy]两台机器公用键盘鼠标

    两台机器公用键盘鼠标 如果是Linux: 下载synergy相关的deb包,然后

  6. linu SSH 不在同一网段的两台机器如何通过ssh通信,SSH限制特定网段登陆的方法

    1. linu SSH 不在同一网段的两台机器如何通过ssh通信 https://blog.csdn.net/lhf19891003/article/details/39895763 https:// ...

  7. keepalived两台机器同时出现vip问题

    配置文件: 主:192.168.1.14 ! Configuration File for keepalived global_defs { script_user root enable_scrip ...

  8. OGG实现两台Oracle数据库的同步

    今天通过最简单的一个例子,给大家讲解下 goldengate 实现两台Oracle数据库的同步.内容如下:1.配置数据库信息.2.安装golden gate.3.配置golden gate.4.测试同 ...

  9. 两台Mysql数据库数据同步实现

    两台Mysql数据库数据同步实现 做开发的时候要做Mysql的数据库同步,两台安装一样的系统,都是FreeBSD5.4,安装了Apache 2.0.55和PHP 4.4.0,Mysql的版本是4.1. ...

随机推荐

  1. 使用Postman做接口测试

    Postman是一个接口测试工具,在做接口测试的时候,Postman相当于一个客户端,它可以模拟用户发起的各类HTTP请求,将请求数据发送至服务端,获取对应的响应结果, 从而验证响应中的结果数据是否和 ...

  2. (16)WiringPi库函数

    8.WiringPi库函数 一.wiringPi简介 wiringPi是应用于树莓派平台的GPIO控制库函数,wiringPi中的函数类似于Arduino的wiringPi系统,wiringPi库包含 ...

  3. 可以使用WinDbg将PE映像作为转储文件打开

    WinDbg.ntsd.cdb.kd和其他任何使用DbgEng打开转储文件的工具都有一个鲜为人知的特性.事实证明,使用DbgEng提供的任何功能,在任何可以打开转储文件(用户转储.内核转储等)的地方, ...

  4. 1.Http讲解

    1.什么是HTTP HTTP(超文本传输协议)是一个简单的请求-响应协议,它通常运行在TCP上. 文本:html,字符串,.... 超文本:图片,音乐,视频,定位,地图... 80端口 HTTPS:安 ...

  5. 动态规划-多维DP

    1.最大正方形 我的瞎猜分析: 我的瞎猜算法: #include <stdio.h> #include <memory.h> #include <math.h> # ...

  6. js时间练习

    编写代码,将当前日期按"2017-12-27 11:11 星期三"格式输出 var t1 = new Date(); console.log(t1.toLocaleString() ...

  7. Axure9 9.0.0.3648 秘钥亲测可用

    用户名: thisProEdition秘钥:PkgeOGle9dSCMXTAczSrTGQZJLcviUJO1kG6onDIH/C68b+AUItWKdbBrmkJsJ0m

  8. glew的安装

    下载链接: https://sourceforge.net/project/downloading.php?group_id=67586&filename=glew-1.5.1-win32.z ...

  9. AMPPZ2014 The Captain

    传送门 BZOJdown Solution 比较妙,考虑按照给出的式子,只有\(x\)相邻或者\(y\)相邻的才会走,不然一定会走到相邻的再走\(x\)或\(y\),所以直接排序两边然后最短路即可. ...

  10. golang字节数组拷贝BlockCopy函数实现

    在C#中,Buffer.BlockCopy(Array, Int32, Array, Int32, Int32) 函数使用比较广泛,其含义: 将指定数目的字节从起始于特定偏移量的源数组复制到起始于特定 ...