Subject: Re: Suggestions for a backup solution
To: Jim Breton <jamesb-netbsd@alongtheway.com>
From: Wojciech Puchar <wojtek@chylonia.3miasto.net>
List: netbsd-users
Date: 01/04/2002 10:45:10
> On Thu, Jan 03, 2002 at 08:51:55PM +0100, Wojciech Puchar wrote:
> > NO!!! it is with extra program no more than 1 screen of code. i could
> > write it if you wish...
>
> If you wouldn't mind, that would be great. :) Thanks!

writing real time so it SHOULD work but may not :)


#/bin/sh
#backup to CD-RW with gzip hack.
#run with -dumplevel as parameter
DUMP_OPTIONS="-b 32 -r 128 -B 100000000 -u"
#change it to whatever your CD-RW fits.
VOLUME_SIZE=$((335000*2048))
#maybe compress for slower machines or gzip without -1 for alpha ;)?
COMPRESSOR="gzip -1"
#Warning - this script assumes that every device, speed and buffer
#settings are already present in /etc/default/cdrecord


cd /tmp/
rm -rf backup
mkdir backup
cd backup
#26*4 volumes is enough? if not add more letters in first for
for x in a b c d;do
for y in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
 mkfifo x$x$y
done
done
dump -f - $DUMP_OPTIONS $* |$COMPRESSOR|split -b $VOLUME_SIZE &
for x in a b c d;do
for y in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
 echo Insert volume $x$y and press any key or CTRL-C if backup is already done
 read line || exit 1
#making sure CD-RW is blanked
 echo Blanking CD-RW...
 cdrecord blank=fast
 echo Recording...
 cdrecord x$x$y
done
done