Skip to content

Instantly share code, notes, and snippets.

@tjstein
Created August 29, 2011 16:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save tjstein/1178763 to your computer and use it in GitHub Desktop.
Save tjstein/1178763 to your computer and use it in GitHub Desktop.
lsyncd conf for multiple targets
settings = {
delay = 1,
maxProcesses = 3,
logfile = "/var/log/lsyncd.log",
}
targetlist = {
"10.0.1.24:/var/www/thomasjstein.com",
"10.0.1.26:/var/www/thomasjstein.com"
}
for _, server in ipairs(targetlist) do
sync{ default.rsync,
source="/var/www/thomasjstein.com",
rsyncOps="-rltvupgo"
target=server
}
end
@Taisgeal
Copy link

This doesn't work as it stands. It only works for the first server in the targetlist pair.
I am using default.rsyncssh, if that helps.

@oscarsmx
Copy link

oscarsmx commented Dec 7, 2016

Maybe mine is what you are looking for

https://gist.github.com/oscarssama/8bc223c8100890f71a07a5a6dc16a7f6

This "sync" all the content of the lsync server to the everyserver in targetlist...

@Taisgeal
Copy link

Taisgeal commented Dec 21, 2016

Yes, that works fine. Thank you very much.

@thanhkhanhcntt
Copy link

I'm setting up an auto scale system. I don't know which IP will be created, I just know subnet. Example, a new server created would have IP 10.220.204.x.
Could you please help me to sync code to all servers after they were created. ?

@josepato
Copy link

josepato commented May 2, 2018

Hi @oscarsmx , I see the link you post return a 404, can you share it again?

I'm trying to setup a 3 node cluster and I need some files to be sync. I'm trying to archive a master-master kind of configuration

@pdostal
Copy link

pdostal commented May 14, 2018

Yes, I'd like to see @oscarsmx's example as well 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment