If you can time stamp when you do it.
Update server 1 with files > timestamp from server 2
Record new timestamp.
Update server 2 from server 1 with delete.
(i.e. fetch new files from server 2 onto 1, then sync server 2 which will
remove dead files that you have deleted. Server 1 is the baseline server).
-----Original Message-----
From: DaZZa
Sent: Tuesday, May 14, 2013 9:16 AM
To: SLUG
Subject: [SLUG] Bi-directional rsync?
Learned ones!
To overcome some crappy web design (two servers, load balanced, no
shared storage), I need to implement rsync to synchronise a directory
between two servers.
Trouble is, it's got to be a two way sync.
I.E. File uploaded to web server 1 (don't ask - I told you it was crap
web design) needs to be available to download from web server 2 if
necessary for future sessions - I.E. I've got to copy the file from
server 1 to server 2 in short order (sub 5 minutes).
I've ALSO got to do the same from server 2 back to server 1 - so if
the incoming upload goes to server 2, it's got to be copied back to
server 1.
Currently, I've got rsync running on both servers every 5 minutes and
synchronising files from 1 to 2, and from 2 to 1. I'd like to just do
this in once process - run rsync on server 1, have it connect to
server 2 and pull/push all files until the directories match.
I don't know if this is even possible with rsync - and if so, I don't
know the options required to make it work.
The current command being used is
rsync -v -rlt <directories>
Can anyone suggest a better option set which could make this a two way
sync by just running on the one server?
Thanks.
DaZZa
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3336 / Virus Database: 3162/6320 - Release Date: 05/13/13
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3336 / Virus Database: 3162/6320 - Release Date: 05/13/13
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html