[Klug-general] Keeping Files in sync but local

MacGyveR macgyver at thedumbterminal.co.uk
Thu Feb 3 21:11:13 UTC 2011


On Thursday 03 Feb 2011, Peter Childs wrote:
> I'm looking for a method, to do the following?
>
> 1. Mainly for keeping config files in sync between multiple boxes but may
> also be other data files. ie the password files.
> 2. File must be local so it can be accessed even before the network is
> working or while part of the network is broken, or while a use is away from
> the network.
> 3. Files must be synced as soon as possible, or when we get back to the
> office.
> 4. There is no master so you can't just copy the master once its been
> updated. (so I can't just scp or rsync them in crontab)
> 5. Tell any programs reading the files that they have been updated, (Like
> Logrotate does)
>
> I'm sure there should be a simple way of doing this, but I'm not even sure
> of the right words to use on Google.....
>
> Thanks
>
> Peter.

I store server configs in SVN (in a mini fs layout) with a copy checked out 
somewhere on the boxes, then you can diff/update the local copy and commit to 
the SVN server when you make a change. With this method to copy a config 
between server you'll need to commit it to SVN first on one host and update 
the checked out copy on another, this gives you a record of what changes are 
made and by who.

You could use a simple text file which states the config file and the command 
to restart/reload the associated process, then have a script to run through 
this, check for changes (md5sum/diff) and run the command. 

This may work for you.

-- 
--------------------------------
http://www.thedumbterminal.co.uk



More information about the Kent mailing list