[NCLUG] Server-to-Server backups

Bob Proulx bob at proulx.com
Tue Jun 27 08:58:38 MDT 2006


DJ Eshelman wrote:
> Since the mail server will require backups for compliance reasons,

Backups have saved me on a number of occasions.  I wouldn't do it for
compliance reasons.  I would backup because backups are a good thing.
It is risk management.

> we've configured both servers with dual hard drives, the second of which is
> sitting untouched as of yet.

Consider doing criss-cross backups from one machine to the other.  The
odds of having a problem with both machines at the same time is
probably low enough.  Unless the problem is admin inflicted.  It is
still a good idea to make non-volatile media backups periodically.

> So, I've never done anything like this before - most backups I've ever done
> have either been a mirror to a drive internally, a tarball to another drive
> or your standard tape backup...
> 
> The question is this can we do a image backup across servers at the bit
> level?  That way, only the changed bits would be backed up.  This is the way
> that Windows DFS works and the speed has suprised me.  Surely we can do the
> same or better!.  I know there should be a way to do incremental backups,
> and if I have no other choice, it's what I'll end up doing... but surely
> there's a way!  As of yet I'm not even sure how to start searching for
> this.  My attempts thus far have been more frustrating than anything else.

I am using rsync for backup for a couple of different sites.  As you
have heard from various people rsync is a good tool and often used for
creating backup processes such as this.  It is a very fast and
efficient tool.

Here are my rsync hints:

 * Use --numeric-ids to turn off id mapping and get a verbatim copy.
   (Of course most dual servers should be similar enough that system
   ids would be identical.  But for the cases where they are not...)

 * I keep a full current image with rolling past incrementals.

   BACKUPDIR=incr-$(date '+%Y-%m-%d')
   BOPTS="--backup --backup-dir=$DESTDIR/$HOST/$BACKUPDIR"

 * I optionally allow an exclude list on the local host.  Of course
   the exclude list gets backed up with everything else.  This is an
   optional file in my case and might not exist on the machine.

   scp $USER$HOST:/etc/backup/exclude.list $EXCLUDEFILE 2>/dev/null || true
   if [ -s $EXCLUDEFILE ]; then
     OPTS="$OPTS --exclude-from=$EXCLUDEFILE"
   fi

 * Always check for errors.

   if ! rsync $OPTS $BOPTS $FROM $TO; then
     ...failed...

 * I delete incrementals older than a certain pipeline number.

  list=$(ls -1dr $DESTDIR/$HOST/incr-* 2>/dev/null | sed 1,${NUM_BACKUPS}d)
  if [ -n "$list" ]; then
    rm -rf $list
  fi

Bob



More information about the NCLUG mailing list