On 12/03 11:20 , martin f krafft wrote:
> before I hack this up myself, I wanted to ask if someone already has
> a solution I could possible reuse.
Not exactly, but if you want to continue with this course, I do have a
script which may serve as a starting point. This started life as a script to
write BackupPC archives to tape, and was thereafter modified to write the
archives to disk attached via USB, so it's a bit crufty. Also, I haven't
looked at it for many years and it hasn't been used for many years, but it
may give you some ideas on how to use if you want to start working.
I'm not even sure it works, for that matter. This is just what I found in my
development archives. It was too many years ago that I worked on this
problem, and the script is plainly in a development sort of phase. (Hence
the bash -x and the FIXME note).
#!/bin/bash -x
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
# temporarily turning this up from 75G to 175G since we're backing up to
# disk
splitsize=175000000000
archiveloc=/var/lib/backuppc/burn/
parfile=0
backupnumber=-1
if [ ! -d $archiveloc ]; then
mkdir -p $archiveloc
fi
# try to mount external disk there
# FIXME - stopgap kludge for testing purposes
/usr/bin/sudo /bin/mount -L LABEL=BACKUP3 $archiveloc
/usr/bin/sudo /bin/chown backuppc $archiveloc
# /usr/bin/sudo /bin/mount $archiveloc
if [ $? -ne 0 ]; then
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!
echo "disk mounting 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.com
firewall.example.com; 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
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/