settings { logfile = "/var/log/lsyncd/lsyncd.log", statusFile = "/var/log/lsyncd/lsyncd-status.log", statusInterval = 5, pidfile = "/var/run/lsyncd.pid" } servers = io.lines("/etc/lsyncd/servers.conf") for line in servers do if not string.find(line,"#") and string.find(line,"[%a%d]") then server = string.match(line,"[%a%d%.]+") sync { default.rsync, source="/var/www/", target=server..":/var/www/", excludeFrom="/etc/lsyncd-excludes.txt", rsync = { compress = true, archive = true, verbose = true, rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no" } } end end