centos7文件实时同步工具lsyncd

简介:

1.本地目录同步

# yum install lsyncd

# vi /etc/lsyncd.conf

----

-- User configuration file for lsyncd.

--

-- Simple example for default rsync, but executing moves through on the target.

--

-- For more examples, see /usr/share/doc/lsyncd*/examples/

--

-- (注释掉这行)sync{default.rsyncssh, source="/var/www/html", host="localhost", targetdir="/tmp/htmlcopy/"}


settings {

    logfile      ="/opt/king/lsyncd.log",

    statusFile   ="/opt/king/lsyncd.status",

    inotifyMode  = "CloseWrite",

    maxProcesses = 7,

    -- nodaemon =true,

}


sync {

    default.rsync,

    source    = "/opt/web",

    target    = "/opt/king",

    -- excludeFrom = "/etc/rsyncd.d/rsync_exclude.lst",

    rsync     = {

        binary    = "/usr/bin/rsync",

        archive   = true,

        compress  = true,

        verbose   = true

        }

}

2.跨服务器目录同步



本文转自 guowang327 51CTO博客,原文链接:http://blog.51cto.com/guowang327/1833604,如需转载请自行联系原作者
相关文章
|
1月前
|
Linux 应用服务中间件 nginx
【PUSDN】centos查看日志文件内容,包含某个关键字的前后5行日志内容,centos查看日志的几种方法
【PUSDN】centos查看日志文件内容,包含某个关键字的前后5行日志内容,centos查看日志的几种方法
43 0
|
6月前
|
JSON Linux 数据格式
百度搜索:蓝易云【Centos 7 通过 targz 文件安装 Elastic Search 服务教程!】
请注意,本教程提供了基本的安装步骤,并且可以根据实际需求进行定制和配置。如果需要更深入的了解和配置,请参考Elasticsearch官方文档或其他权威资源。
282 0
|
6月前
|
Linux 网络安全 开发工具
如何在 Linux CentOS 8 中搭建 GitLab 私有仓库并结合 Cpolar 内网穿透工具实现公网访问私有仓库【无公网IP内网穿透】
如何在 Linux CentOS 8 中搭建 GitLab 私有仓库并结合 Cpolar 内网穿透工具实现公网访问私有仓库【无公网IP内网穿透】
|
4月前
|
网络协议 Unix Linux
Centos下nfs+rpcbind实现服务器之间的文件共享
Centos下nfs+rpcbind实现服务器之间的文件共享
91 0
|
7月前
|
缓存 运维 Linux
Linux(CentOS)运维脚本工具集合
Linux(CentOS)运维脚本工具集合
141 2
|
2月前
|
Java Shell Linux
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
|
6月前
|
网络协议 关系型数据库 MySQL
【Linux环境】Centos7.x 安装MySQL,使用Navicat等远程连接工具报2003-Can‘t connect to MySQL server on(10060 Unknown err)
【Linux环境】Centos7.x 安装MySQL,使用Navicat等远程连接工具报2003-Can‘t connect to MySQL server on(10060 Unknown err)
209 0
|
7天前
|
网络协议 Linux 网络安全
centos7下最简单的 unison实现文件双向同步图文详解
centos7下最简单的 unison实现文件双向同步图文详解
10 0
|
1月前
|
存储 监控 Linux
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
【2月更文挑战第17天】Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
26 1
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
|
5月前
|
安全 Unix Linux
Centos虚拟机安装配置与MobaXterm工具及Linux常用命令(下)
Centos虚拟机安装配置与MobaXterm工具及Linux常用命令(下)
112 0

热门文章

最新文章