多台服务器
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" }