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,如需转载请自行联系原作者
上一篇:IIS上虚拟站点的web.config与主站点的web.config冲突解决方法


下一篇:SQL基础知识V2——BETWEEN