安装及配置

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. Ubuntu设置终端操作行为的回收站

    Ubuntu设置终端操作行为的回收站(默认情况下,在终端删除文件,会直接删除) 参考自:https://help.aliyun.com/knowledge_detail/41359.html?spm= ...

  2. class struct Equals

    { class clsA { private int _i; public int I { set { _i = value; } get { return _i; } } } struct strc ...

  3. Spark两种内存管理

    Spark动态内存管理 Spark 1.6 后改为动态内存管理(如果想启用静态内存管理,方法下面会介绍),启动动态主要体现在 存储内存和执行内存的动态.

  4. pipelinewise 学习二 创建一个简单的pipeline

    pipelinewise 提供了方便的创建简单pipeline的命令,可以简化pipeline 的创建,同时也可以帮我们学习 生成demo pipeline pipelinewise init --n ...

  5. Redis之eval+lua实现初步

    目录 目录 1 1. 前言 1 2. 执行方式 1 3. 执行过程 3 4. 使用原则 3 1. 前言 Redis的实现保证eval的执行是原子的,即使eval执行的lua超时,Redis也不会自动终 ...

  6. kafka设计要点之高吞吐量

    2345678910111213141516 /** * Delete this log segment from the filesystem. * * @throws KafkaStorageEx ...

  7. 第10组 Alpha冲刺(3/4)

    队名:凹凸曼 组长博客 作业博客 组员实践情况 童景霖 过去两天完成了哪些任务 文字/口头描述 继续学习Android studio和Java 制作登录注册界面前端 展示GitHub当日代码/文档签入 ...

  8. 年轻人的第一个自定义 Spring Boot Starter!

    陆陆续续,零零散散,栈长已经写了几十篇 Spring Boot 系列文章了,其中有介绍到 Spring Boot Starters 启动器,使用的.介绍的都是第三方的 Starters ,那如何开发一 ...

  9. zookeeper(一) 原理

    参考文档:http://cailin.iteye.com/blog/2014486/ http://www.uml.org.cn/zjjs/201707282.asp?artid=19686 一.zo ...

  10. [转]怎样与 CORS 和 cookie 打交道

    原文地址:https://segmentfault.com/a/1190000018756960 前言 CORS 与 cookie 在前端是个非常重要的问题,不过在大多数情况下,因为前后端的 doma ...