rsync是unix/linux下同步文件的一个高效算法,它能同步更新两处计算机的文件与目录,并适当利用查找文件中的不同块以减少数据传输。

Linux守护进程的运行方式:
1.独立运行(stand-alone)的守护进程,独立运行的守护进程由init脚本负责管理
2.xinetd模式运行独立的守护进程

配置rsync服务端:/etc/rsyncd.conf主配置配件(默认不存在)

uid = root
gid = root
max connections = 4
read only = true
hosts allow = *
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
[data0]
path = /data0 //注意这里的目录
comment = test
read only = false
list = false
auth users = shihan1 //注意这里的用户名
secrets file = /etc/rsyncd.pas //用户名密码文件

vim /etc/rsync.pas 配置密码 , 远程rsync服务器的帐户密码文件的权限必须为600

chmod 600 /etc/rsync.pas

shihan1:12341234

运行rsync --daemon  

往主机推数据:  

rsync -avzP --delete /mnt/public/phpdev/187_test/2018-12-awk-uniq.txt shihan1@服务器ip::data0/

从主机拉数据:

rsync -avzP shihan1@服务器ip::data0/* .

[Linux] 搭建rsync服务端的更多相关文章

  1. Centos6.9 搭建rsync服务端与客户端 案例:全网备份项目

    rsync的企业工作场景说明 1)定时备份 1.1生产场景集群架构服务器备份方案项目 借助cron+rsync把所有客户服务器数据同步到备份服务器 2)实时复制 本地数据传输模式(local-only ...

  2. 最全Linux搭建SVN服务端教程

    文章首推 支付宝接口对接 高德地图调用 验证码登录 QQ邮箱登录 今日主题:Linux搭建SVN服务端 简介 相信程序员对SVN还是不陌生的,虽然现在用Git比较多,但是SVN也是用的,SVN可以做代 ...

  3. Linux搭建rsync服务

    一.Rsync的简单介绍 Rsync是一款开源的.快速的.多功能的.可实现全量及增量(全量备份是指全部备份,增量备份是在上一次备份的基础上只备份更新的内容)的本地货远程数据同步备份的优秀工具.Rsyn ...

  4. linux 搭建SVN服务端

    搞了个服务器,然后现在想搞点事情,于是乎整个SVN在上面,算是熟悉下svn的操作过程 以下内容转载自: https://yq.aliyun.com/articles/6693 ------------ ...

  5. Linux搭建git服务端

    1.安装$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel$ yum inst ...

  6. 《用OpenResty搭建高性能服务端》笔记

    概要 <用OpenResty搭建高性能服务端>是OpenResty系列课程中的入门课程,主讲人:温铭老师.课程分为10个章节,侧重于OpenResty的基本概念和主要特点的介绍,包括它的指 ...

  7. CentOS7下rsync服务端与Windows下cwRsync客户端实现数据同步配置方法

    最近需求想定期备份服务器d盘的数据到Linux服务器上面,做个笔记顺便写下遇到的问题 以前整过一个win下的cwrsync(客户端)+rsync(服务端:存储)的bat脚本 和整过一个Linux下的r ...

  8. OpenResty搭建高性能服务端

    OpenResty搭建高性能服务端   Socket编程 Linux Socket编程领域为了处理大量连接请求场景,需要使用非阻塞I/O和复用,select.poll.epoll是Linux API提 ...

  9. contos7搭建syslog服务端与客户端

    搭建中心服务端1,编辑文件/etc/rsyslog.conf,找到以下内容,将前面的#注释符合去除#$ModLoad imtcp#$InputTCPServerRun 514 2,在/etc/rsys ...

随机推荐

  1. icpc2018焦作-I. Distance

    第一发又超时了... 题目大意:给你n个点,然后给你n-1的数,表示两两距离,然后让你输出n个答案,第i个答案表示从这n个点里面挑i个点,然后这i个点两两之间会有一个距离,答案要求这些距离和的最大值. ...

  2. js的一些function

    /** * * 根据秒数返回 一个日期范围 * timerFilter(10) */ function timerFilter(n) { let days = 31; // 一月多少天 const o ...

  3. swust oj 1014

    交换排序算法的设计与实现——冒泡排序 1000(ms) 10000(kb) 2640 / 7503 编程实现冒泡排序,按照非递减排序,测试数据为整数. 输入 第一行是待排序数据元素的个数: 第二行是待 ...

  4. idea Empty git --version output:解决

    在使用idea下的git时候发现报错 但看了一下我的git-bas位置确实没有错啊,也可以启动 后来google了才下发现原来idea的这个地方不用引用的git-bash.exe的路径,而是git.e ...

  5. 动态规划----最长递增子序列问题(LIS)

    题目: 输出最长递增子序列的长度,如输入 4 2 3 1 5 6,输出 4 (因为 2 3 5 6组成了最长递增子序列). 暴力破解法:这种方法很简单,两层for循环搞定,时间复杂度是O(N2). 动 ...

  6. [Swift]LeetCode188. 买卖股票的最佳时机 IV | Best Time to Buy and Sell Stock IV

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  7. [Swift]LeetCode301. 删除无效的括号 | Remove Invalid Parentheses

    Remove the minimum number of invalid parentheses in order to make the input string valid. Return all ...

  8. [Swift]LeetCode1006. 笨阶乘 | Clumsy Factorial

    Normally, the factorial of a positive integer n is the product of all positive integers less than or ...

  9. 【TOGAF】总体认知

    TOGAF是什么 TOGAF(The Open Group Architecture Framework)是当前最为流行的企业架构框架理论之一,它为一个企业或组织对于企业架构的接受.创建.使用和维护提 ...

  10. Python内置函数(5)——bin

    英文文档: bin(x) Convert an integer number to a binary string. The result is a valid Python expression. ...