centos7服务器文件同步,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.跨服務器目錄同步
參考:
總結
以上是生活随笔為你收集整理的centos7服务器文件同步,centos7文件实时同步工具lsyncd的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 北京环球影城让带吃的进去吗
 - 下一篇: 战神诸神黄昏斯瓦塔尔法海姆诺伦三女神宝箱