Skip to content

Instantly share code, notes, and snippets.

@rjohnsondev
Forked from oscarsmx/lsyncd.conf
Created August 23, 2017 12:33
Show Gist options
  • Save rjohnsondev/8ba5f1bc67bdfd2e623367d6c85ae4ba to your computer and use it in GitHub Desktop.
Save rjohnsondev/8ba5f1bc67bdfd2e623367d6c85ae4ba 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