Skip to content

Instantly share code, notes, and snippets.

@oscarsmx
Created December 7, 2016 07:23
Show Gist options
  • Save oscarsmx/8bc223c8100890f71a07a5a6dc16a7f6 to your computer and use it in GitHub Desktop.
Save oscarsmx/8bc223c8100890f71a07a5a6dc16a7f6 to your computer and use it in GitHub Desktop.
Multiple Server, Host Lsync Config 2016
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd-status.log",
statusInterval = 10
}
-- Slaves
targetList = {
"127.0.0.1",
"127.0.0.2",
"127.0.0.3"
}
-- Sync Conf
--- Exclude work at source level
for _, servers in ipairs(targetList) do
sync {
default.rsyncssh,
source = "/home/nginx/domains/oscars.mx/public",
exclude = {
'/_tmp/', '/_cache/'
},
host = servers,
targetdir = "/home/nginx/domains/oscars.mx/public/",
rsync = {
compress = true,
owner = true,
perms = true
},
ssh = {
port = 2233
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment