JP Vossen on 21 Mar 2012 23:29:04 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] PLUG W follow-up

Jeezzz... I agree with Fred, we need minutes... Or a podcast, or a transcript, or something... :-)

We also talked about the 'Unison' mirror tool that uses rsync under the covers with local state files.

I am using that from a cron script to keep 3 read-write "masters" in sync. Server A is in my basement, server C is in a lab in California, and neither can talk to the other due to firewalls beyond my control. Both are read-write for RPMs, Clonezilla ISO files, some documentation and so forth. (Code is in CVS (sigh) elsewhere.)

However, both servers can talk to server B, in some data center someplace, and it turns out that doing some read-write activity there would be handy too. So...I need to keep 3 read-write "masters" in sync...

Unison can do that from cron or interactively over SSH or even via a GUI (though I don't run GUIs on servers). It will detect single-file conflicts (using hashes in the local state files), but as Baskar pointed out this is not atomic, so incompatible changes made to more than a single file could be a problem. That is not a concern for me, given my data, but YMMV.

If it does detect a conflict, it skips that file and logs it, and I get an email from cron and can go fix it. Unison is cross-platform (Linux, Mac, Solaris, Windows) and has batch, text console and GUI interfaces. I also use it to sync local copies of my Windows "H:" drive to my $WORK laptop if I travel.

For these servers I sync like this daily:
	B <--> C   # Faster link
	B <--> A   # Slower link
	B <--> C   # Again, in case more changes from above

Works great for me, where rsync would not.  YMMV.
JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --