On 5/16/05, Devraj Mukherjee <[EMAIL PROTECTED]> wrote:
> I am in a situation where I am managing two Gentoo servers one of which
> is the mirror of the other. I wish to mirror the two servers such that
> one can be used as a replacement almost instantly if the other fails.
> These servers are NOT available parallelly, its one or the other.

I've done this with rsync, but I only synchronized configuration files:

#!/bin/bash
eval "$(emerge info | grep CONFIG_PROTECT)"
set -x
rsync -e 'ssh' -CavP --stats \
        $( for d in ${CONFIG_PROTECT}; do
                [ -e ${d} ] && echo --include ${d}/
        done) \
        --include-from /etc/syncconfig/include \
        $( for d in ${CONFIG_PROTECT_MASK}; do
                [ -e ${d} ] && echo --exclude ${d};
        done) \
        --exclude-from /etc/syncconfig/exclude \
        --exclude '/*' \
        --backup --backup-dir /var/config/$(date '+%Y-%m-%d') \
        --delete --delete-after / ${1}:/

This leverages CONFIG_PROTECT and CONFIG_PROTECT_MASK from Portage,
plus has two additional files to list manually excluded or included
files, and keeps old configuration files in /var/config on the
destination.

-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html

-- 
[email protected] mailing list

Reply via email to