多台服务器

settings {
   logfile    = "/var/log/lsyncd/lsyncd.log",
   statusFile = "/tmp/lsyncd.status",
   inotifyMode = "CloseWrite or Modify",
   statusInterval = 1
}

sync {
   default.rsyncssh,
   host="10.1.8.17",
   source="/root/A",
   targetdir="/root/B",
   --excludeFrom="/etc/lsyncd_exclude.lst",
   maxDelays = 5,
   delay = 0,
   rsync = {
     archive = true,
     compress = false,
     -- verbose   = true
   },
   ssh = {
     port = 8122
   }
}

单台服务器目录同步

settings {
    logfile    = "/var/log/lsyncd/lsyncd.log",
    statusFile = "/tmp/lsyncd.status",
    inotifyMode = "CloseWrite or Modify",
}

sync {
    default.direct,
    source = "/root/A/",
    target = "/root/B"
}

 

posted on 2024-12-20 16:46  属于我的梦,明明还在  阅读(17)  评论(0编辑  收藏  举报