Sync multiple servers
Greg Matthews
gmatt at nerc.ac.uk
Fri Mar 28 10:25:34 GMT 2008
Oliver Falk wrote:
> Have a look at csync2:
>
> http://oss.linbit.com/csync2/
>
> -of
>
> Julian Field wrote:
>> Read "man rsync" :-)
I use rdist with a config file that provides a few different file groups
and exceptions, like this:
ssh-add -l && rdist -P /usr/bin/ssh -f ~/mydistfile mail
where "mail" is a section in ~/mydistfile, a cut down version of which
looks a bit like this:
# dist file for use with rdist
# usage: rdist -f <thisfile> -P /usr/bin/ssh [target]
HOSTS = ( root at mailserver1 root at mailserver2 )
MAILFILES = ( /etc/mail /etc/MailScanner /etc/sysconfig/RulesDuJour
/etc/logwatch /var/www/html/mailscanner/docs* )
EXMAIL = ( /etc/mail/localnames /usr/local/bin/mailq.php
/etc/mail/namelist /etc/mail/logs /etc/mail/saveweek
/etc/mail/statistics /etc/mail/stats /etc/mail/sendmail.cf*
/etc/mail/sendmail.mc* /etc/mail/*.db /etc/MailScanner/bayes*
/etc/mail/curdfile /etc/mail/curdfile.new
/etc/mail/spamassassin/RulesDuJour/*.cf.* /etc/mail/nosanity
/etc/mail/*.temporary /etc/mail/warnaliases
/etc/MailScanner/phishing.safe.sites.conf.old
/etc/mail/spamassassin/sa-update-keys/* /etc/mail/list/pol-staff-list
/etc/mail/list/mba-staff-list /etc/mail/list/itss-staff-list
/etc/mail/extraaliases /etc/mail/access /etc/mail/spamassassin/RulesDuJour )
EXSOFT = ( /local/software/build/* )
mail:
${MAILFILES} -> ${HOSTS}
# install -owhole,remove /tmp/rdist-test ; # testing
install -owhole,remove /;
except ${EXMAIL} ;
the use of ssh-add -l before calling rdist is to check that you have
added the ssh keys to your agent otherwise you get into a tangle with
password prompts if you are trying to rdist to more than one host at a time.
I have other sections in mydistfile for syncing other areas (such as the
software package area containing tar files for current software). Has
worked great for a few years now.
GREG
--
Greg Matthews 01491 692445
Head of UNIX/Linux, iTSS Wallingford
--
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.
More information about the MailScanner
mailing list