I have lsyncd running on my main server, to sync files on all servers. But when I add another folder to be synced, the service won't start again. I can't seem to find any errors in logs. I'm no Lua expert, so might be something obvious I'm missing.
This is my orignal script, that works:
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status",
statusInterval = 10
}
servers = {
"user@xx.xx.xx.xx",
"user@xx.xx.xx.xx"
}
for _, server in ipairs(servers) do
sync {
default.rsyncssh,
source="/path/to/source/folder/one",
host=server,
targetdir="/path/to/target/folder/one",
excludeFrom="/etc/lsyncd/lsyncd-excludes.txt",
rsync = {
compress = true,
archive = true,
verbose = true,
rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no"
}
}
end
This is the script that doesn't work, where I have added another folder:
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status",
statusInterval = 10
}
servers = {
"user@xx.xx.xx.xx",
"user@xx.xx.xx.xx"
}
for _, server in ipairs(servers) do
sync {
default.rsyncssh,
source="/path/to/source/folder/one",
host=server,
targetdir="/path/to/target/folder/one",
excludeFrom="/etc/lsyncd/lsyncd-excludes.txt",
rsync = {
compress = true,
archive = true,
verbose = true,
rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no"
}
}
sync {
default.rsyncssh,
source="/path/to/source/folder/two",
host=server,
targetdir="/path/to/target/folder/two",
excludeFrom="/etc/lsyncd/lsyncd-excludes.txt",
rsync = {
compress = true,
archive = true,
verbose = true,
rsh = "/usr/bin/ssh -p 22 -o StrictHostKeyChecking=no"
}
}
end
I've also tried putting them in two different loops, but still no luck. Spent hours scraping the internet for answers, but everything I find points to I'm doing it correctly.