BackupPC-users

Re: [BackupPC-users] How exactly to archive backup?

2010-12-01 11:22:43
Subject: Re: [BackupPC-users] How exactly to archive backup?
From: Carl Wilhelm Soderstrom <chrome AT real-time DOT com>
To: gayleard AT eircom DOT net, "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 1 Dec 2010 10:20:04 -0600
On 12/01 02:40 , Timothy Murphy wrote:
> 1. I'm not sure, in the case of a disaster on my server,
> how exactly I could retrieve the archive
> to say a different hard disk on the server,
> or even a different machine.

The archives that BackupPC makes (at least with the script below) are tar
archives; so just treat them like any other restore from a tarball.
 
> 2. I'd be really grateful for a sample archive setup
> implementing a safety backup onto an external hard disk
> as described above.

Here's one that we use at one location. It's ugly and crufty and not well
written; having been kludged together and hacked and rehacked over the
years. was originally written to archive to tape; now it archives to disk.
This is provided with no warrantee, and if it breaks you get to keep both
pieces.

#!/bin/bash

TAPEDEV=/dev/st0

Installdir=/usr/share/backuppc

tarCreatePath=$Installdir/bin/BackupPC_tarCreate
splitpath=/usr/bin/split
parpath=/usr/bin/par2
compression=/bin/gzip
compext=.gz
splitsize=225000000000
archiveloc=/var/lib/backuppc/burn/
parfile=0
backupnumber=-1

if [ ! -d $archiveloc ]; then
    mkdir -p $archiveloc
fi

# try to mount external disk there
/usr/bin/sudo /bin/mount /dev/sdb1 $archiveloc
if [ $? -ne 0 ]; then
    echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
    echo "disk mounting failed! aborting archive!"
    echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
    exit 1
fi
/usr/bin/sudo /bin/chown backuppc $archiveloc
# /usr/bin/sudo /bin/mount $archiveloc
if [ $? -ne 0 ]; then
    echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
    echo "disk ownership change failed! aborting archive!"
    echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
    exit 1
fi

rm -f $archiveloc/*.*
if [ $? -ne 0 ]; then
    echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
    echo "Cleaning up old files failed! Aborting!"
    echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
    exit 1
fi

for host in localhost server server1 server2 mail.example.tld host.example.tld; 
do
    $Installdir/bin/BackupPC_archiveHost $tarCreatePath $splitpath \
      $parpath $host $backupnumber $compression $compext $splitsize \
      $archiveloc $parfile \*
done

size=`du -s /var/lib/backuppc/burn/|cut -f 1`
if [ $size -lt $splitsize ]; then 
        echo data will fit on one tape; 
    else 
        echo FATAL! Data will NOT fit on one tape!; 
        exit 1
fi

#tar -cv --totals -f $TAPEDEV $archiveloc/*.*
#if [ $? -ne 0 ]; then 
#       echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
#       echo ERROR when dumping to tape!
#       echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
#fi
#
# unmount the disk 
/usr/bin/sudo /bin/umount /var/lib/backuppc/burn


-- 
Carl Soderstrom
Systems Administrator
Real-Time Enterprises
www.real-time.com

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>