centos7 使用rsync 实现文件同步

一、服务端(192.168.8.81):

  1. 安装软件:
    yum  -y  install  rsync
  2. 创建需同步的目录:
    mkdir  -p  /home/root/rsync
  3. 编辑配置文件:vim /etc/rsyncd.conf
    motd file = /etc/rsyncd.motd
    transfer logging = yes
    log file = /var/log/rsyncd.log
    port = 873
    address = 192.168.8.81
    uid = root
    gid = root
    use chroot = no
    read only = no
    max connections = 10
    [common]
    comment = rsync lee
    path = /home/lee/rsync/
    ignore errors
    auth users = lee
    secrets file = /etc/rsyncd.secrets
    hosts allow = 192.168.8.0/255.255.255.0
    hosts deny = *
    list = false
  4. 创建用户密码:
    echo  "root:123456"  >  /etc/rsyncd.secrets
    chmod  600  /etc/rsyncd.secrets
  5. 配置防火墙规则:
    iptables  -I  INPUT  -p  tcp  --dport  873  -j  ACCEPT
  6. 启动服务:
    rsync  --daemon
    echo  "rsync  --daemon"  >>  /etc/rc.local

二、客户端(192.168.8.82):

  1. 安装软件:
    yum  -y  install  rsync
  2. 创建需同步的目录:
    mkdir  -p  /home/root/rsync
  3. 创建密码文件(免输入密码):
    echo  "123456"  >  /root/passwd
    chmod  600  /root/passwd
  4. 拉取(在客户端(192.168.8.82)):
    rsync  -avz  --password-file=/root/passwd  root@192.168.8.81::common  /home/root/rsync/

    centos7安装配置rsync

  5. 推送(在服务端(192.168.8.81)):
    rsync  -avz  --password-file=/root/passwd  /home/root/rsync/  root@192.168.8.81::common

    centos7安装配置rsync

 

三、实现定时自动同步

    创建一个需要定时执行的脚本文件,如:rsyncd.sh脚本:vi  /etc/rsyncd.sh
            (路径自己设置的),在此脚本中添加如下内容
             
 
    设置脚本执行的时间:crontab –e,添加如下内容  
            

转载于:https://www.cnblogs.com/pangguoming/p/9855244.html

Centos7.x部署lsyncd和rsync实现文件的实时同步 既然rsync可以实现服务器间的文件同步,为何还需要lsyncd?CentOS 7.6 最小化安装A(192.168.123.100):Rsync客户端+lsyncdB(192.168.123.200):Rsync服务端(daemon模式)当A服务器中的文件发生变化(新增、修改、删除),实时推动到B服务器。 阅读详情

相关推荐

Centos7 利用rsync 实现文件同步

测试环境 CentOS 7.4 Rsync服务端:192.168.1.6 CentOS 7.4 Rsync客户端:192.168.1.15 rsync同步方式 第一种方式:rsync通过ssh方式同步 1、Rsync服务端和客户端都需要安装rsync yum -y install rsync 2、使用 前提:需知道远程服务器开启ssh端口和账号密码 A、推文件: rsync -av /etc/passwd 192.168.1.6:/tmp/passwd.t...

weixin_45203131的博客 408

Centos7利用rsync实现文件同步

0x01测试环境 CentOS 7.4 Rsync服务端:192.168.204.130 CentOS 7.4 Rsync客户端:192.168.204.168 0x02 rsync同步方式 第一种方式:rsync通过ssh方式同步 1、Rsync服务端和客户端都需要安装rsync [root@localhost ~]# yum -y install rsync...

319

Centos7通过(rsync+crontab)和(rsync+Inotify)实现文件自动同步-手动+计划同步非实时+实时自动同步+互为主备

最近在实施一个web项目,要搭载tomcat的负载均衡,可是有一个问题这个web项目有变更怎么自动同步呢?有很多种方法,现在讲运用第一种方法rsync来进行同步并部署计划:网上有很多这样配置方法我觉得太过于麻烦,没有系统性地讲好。 测试环境最好放在docker容器里面测试好后再进行生产环境部署。 环境: 1. Centos7 + rsync 服务器A【主更新端】 2. Centos7 ...

漫步技术小栈的博客 1015

【操作系统】Centos7系统搭建Rsync数据同步实战

Rsync数据同步

互联网小阿祥 2732

如何在Linux上安装文件同步工具:FreeFileSync

文件同步是最需要的功能之一,尤其是在共享文件时,不仅如此,它还可以很好地用于将数据与云存储同步。因此,如果您正在寻找一种可免费获得且易于在 Linux 上使用的工具,请不要错过本文。

网络技术联盟站 2595

FreeFileSync文件同步工具V10.9linux最新版

FreeFileSync Linux版是一款用于文件同步和文件比较的小工具,简单易用,可以为你比较文件夹的不同之处,并且轻松的实现同步,需要的朋友不妨前来本站下载使用。 Mac版: 文件同步工具FreeFileSync For MAC V9.8 Mac OS X 64位 苹果电脑版 windows版:FreeFileSync 文件同步工具 v10.9 官方中文安装版 相关介绍 首先是文件

【同步】文件同步命令rsync |自动同步软件FreeFileSync

目录 linux文件同步 即看即用 详细说明 FreeFileSync 同步文件 1、设置同步源和目标 2、手动同步 3、自动同步 设置同步方向 批处理 其他类似软件 linux文件同步 即看即用 本地: 表示把本地/data目录下的文件同步到本地/backup目录下 rsync -avz /data/ ...

小鱼菜鸟的博客 1749

利用脚本实现oracle数据库双机备份

利用脚本实现oracle数据库双机备份,脚本写好了,双机备份很容易

CentOS7部署lsyncd+rsync实现服务器文件实时同步

文章z转自:https://blog.51cto.com/qiangsh/2459022 Lsyncd是什么? Github:axkibe/lsyncd 官方文档:Lsyncd – Live Syncing (Mirror) Daemon Lysncd即Live Syncing Daemon,它是开源的数据实时同步工具(后台进程),基于inotify和rsync。 Lsyncd是一个辅助文件同步工具。它通过监听系统的文件变化事件,调用rsync进行同步。注意“辅助”二字,辅助的意思是:同步文件本身并不是由l

weixin_43054437的博客 1467

AI驱动的研发流程:定义高度专业和系统化的规划基准

在人工智能(AI)浪潮席卷全球的今天,软件研发的范式正经历着一场深刻而迅速的变革。AI技术的渗透,从最初的辅助工具角色,正逐步演变为驱动整个研发流程的核心引擎。传统的研发流程和项目管理方法论,在面对AI带来的高效率、高智能以及高复杂性挑战时,显得力不从心。企业对快速交付高质量软件产品、有效控制风险、并保证全流程可追溯性的需求日益迫切。

形上得其象,形下合于数;阴阳自济,玄理自明。 2186

龙芯3A5000开发板PMON升级UEFI固件实战指南

固件是计算机硬件与操作系统之间的关键桥梁,负责初始化硬件并引导系统启动。其工作原理是在上电后执行自检、加载引导程序,最终将控制权移交操作系统。在国产化平台中,采用标准化的UEFI固件具有重要技术价值,它能提供图形化配置界面、统一硬件驱动模型,并支持安全启动等现代特性,从而显著提升硬件兼容性与系统管理效率。这一技术广泛应用于PC、服务器及嵌入式设备,尤其在需要运行银河麒麟等主流操作系统的龙芯开发板场景中,将传统PMON固件升级至UEFI,能实现更流畅的系统安装与更稳定的运行体验。本文基于固件升级与UEFI引导

weixin_42664597的博客 568

使用 Rsync + Lsyncd 实现 CentOS 7 实时文件同步

在分布式系统中,数据同步是一个重要的需求,尤其是当我们希望将两台服务器的数据保持一致时。rsync和lsyncd是两种常见的数据同步工具,它们能高效地处理文件同步和实时数据同步。本文将通过在两台 CentOS 7.9 服务器上配置rsync和lsyncd,展示如何进行数据同步的操作和配置。rsync:是一款用于远程和本地文件同步的工具,支持增量传输,能有效减少网络带宽的使用。它通常用于备份和镜像操作。lsyncd:是一个基于rsync的实时同步工具,它利用inotify。

XMYX-0 1984

mfcc总结,这个mel三角滤波器分组到底是如何起作用的呢?

先看fft频谱图(这是4096字节取样fft计算,横轴频率是从0到512,后边意义不大,未取,纵轴是振幅),那些我随便画的蓝色线,你有什么联想?: 再看,这绿色线,是否有一种上升后,便逐渐式微的感觉,都是三角形的,这或许也是mel当初和绝大多数人看到的: 如果在振幅上加上一条限制的黑线(振幅门槛限制),黑色线以下很多频率就没有意义了,你看,有用的频率连一半(512/2=256)都占不到...

ganggangwawa的博客 9913

java rsync上传_CentOS7配置rsync实现文件同步

rsync(remote synchronize )是一个远程文件同步工具,支持多个操作系统,用于在多台服务器之间同步目录和文件。rsync采用增量传输文件的方法,只传输新文件和修改过的文件,而不是每次都全部传输,效率比较高。rsync有以下特点:1)支持目录和文件的上传和下载功能;2)可以镜像保存整个目录树和文件系统;3)传输效率高,只传输新增和修改过的文件。一、安装软件包rsync的客户端和服...

weixin_39922374的博客 461

LabVIEW进行MQTT通信及数据解析

该文章介绍了LabVIEW的MQTT通信的开源VI控制,以及如果进行数据的解析,特别是一些需要注意的点

heda3的博客 4115

Weka学习笔记01:初探Weka世界

下载、安装和启动Weka、Weka数据格式

howard2005的专栏 1481

CentOS7 rsync+sersync实现文件实时同步

CentOS7 rsync+sersync实现文件实时同步 rsync基本命令和语法 一、概念 Rsync(remote sync)是UNIX 及类UNIX 平台下一款神奇的数据镜像备份软件,它不像FTP 或其他文件传输服务那样需要进行全备份,Rsync 可以根据数据的变化进行差异备份,从而减少数据流量,提高工作效率。你可以使用它进行本地数据或远程数据的复制,Rsync 可以使用SSH 安全隧道进...

m0_37851993的博客 970

ESP32-S3 调试经验:使用 ESP-PROG 与内置 USB-JTAG

关键词:ESP32 调试、ESP32-S3、ESP-PROG、JTAG、VSCode、OpenOCD、GDB作为一个前端开发转硬件调试新手,我最近花了不少时间在上。因为国内开发者常用 ESP32 做 IoT 项目,但大多数教程都比较零散,有些还过时,所以我决定把这次调试经历整理下来,希望能帮到后来人。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1238

centos 多台 文件夹同步_CentOS7配置rsync实现文件同步

rsync(remote synchronize )是一个远程文件同步工具,支持多个操作系统,用于在多台服务器之间同步目录和文件。rsync采用增量传输文件的方法,只传输新文件和修改过的文件,而不是每次都全部传输,效率比较高。rsync有以下特点:1)支持目录和文件的上传和下载功能;2)可以镜像保存整个目录树和文件系统;3)传输效率高,只传输新增和修改过的文件。一、安装软件包rsync的客户端和服...

weixin_39756895的博客 994

AutosarMCAL开发——基于TC3x系列时钟系统浅析

本文为博主个人学习总结记录,如有不正,欢迎指正。

qq_45583706的博客 891

ArcGIS与地理加权回归GWR【一】

因此,在实际问题研究中我们经常发现回归参数在不同地理位置上往往表现为不同,也就是说回归参数随地理位置变化,这时如果仍然采用全局空间回归模型(全局假设β是不会变得),得到的回归参数估计将是回归参数在整个研究区域内的平均值,如上所说某一个因素在ABC等不同的地理位置对房价的影响是不同的,假如采用全局空间回归模型,便忽略了数据的空间位置属性,只反映平均意义下因变量与自变量的相关关系,而不能有效反映回归关系的空间非平稳性的特征。当自变量为1个时,是一元线性回归,自变量为2个及以上时,称为多元线性回归。

JData_Engineer的博客 1380

Centos7利用rsync实现文件同步和ssh免密登录

(1)实验环境   两台CentOS7:     youxi1  192.168.1.6     youxi2  192.168.1.7   这里我将防火墙关闭进行实验,如果防火墙开启,请将端口加入到防火墙规则中。 (2).目标   在ssh端口不为22的情况下,进行单向免密登录或双向免密登录(端口不一致) (3).实验   首先修改两台服务器的端口,vim /etc/ssh/sshd_config,找到如下部分 1 #Port 22   将#去除

qq_32421489的博客 1446

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

CentOS7之Rsync+Inotify架构实现实时同步文件和文件夹

简介:rsync是用来同步文件和文件夹的,inotify是用来实现监听变动而自动同步的 OS:Centos7.3 服务器端:172.16.13.157 客 户 端 :172.16.13.156 目 标 :客户端文件夹内容变动后,自动同步到客户端上,使内容保持一致 下载https://github.com/rvoicilas/inotify-tools/wiki 部...

weixin_34388207的博客 140

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 终极解决方案:org.apache.jasper.JasperException: java.lang.IllegalStateException: getOutputStream() has alr...
下一篇: 流媒体Red5服务自定义媒体文件路径
aotun7642
博客等级 码龄10年 16粉丝 123原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值