IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    lsyncd for osx. mac下自动同步文件到局域网的机器

    mmfei发表于 2016-10-31 07:06:54
    love 0

    -- install :
    -- lsyncd for osx
    -- local dir -> ssh 
    -- brew install lsyncd
    -- brew install rsync ; /usr/local/bin/rsync instead of local rsync
    -- start up : sudo lsyncd ~/a.config
    
    
    -- file ~/a.config
    settings {
        logfile      ="/var/log/lysncd/lsyncd.log",
        statusFile   ="/var/log/lysncd/lsyncd.status",
        inotifyMode  = "CloseWrite",
        maxProcesses = 7,
        -- nodaemon =true,
        }
    
    sync {
        default.rsync,
        source    = "/data1/htdocs/fanxing.kugou.git/",
        target    = "www@10.16.6.91:/data1/htdocs/kfwlf.kugou.com/",
    	exclude = {"/data1/htdocs/fanxing.kugou.git/.git"},
        -- excludeFrom = "/etc/rsyncd.d/rsync_exclude.lst",
        maxDelays = 1,
        delay = 3,
        delete = true,
        -- init = true,
        rsync     = {
            binary = "/usr/local/bin/rsync",
            archive = true,
            compress = true,
            bwlimit   = 2000,
            rsh = "/usr/bin/ssh -l www -i /Users/mmfei/.ssh/id_rsa -p 32200 -o StrictHostKeyChecking=no"
            -- 如果要指定其它端口,请用上面的rsh
            }
        }

     



沪ICP备19023445号-2号
友情链接