another stupid dump question

Andrew Mathews andrew_mathews
Mon May 17 11:47:10 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Wunder wrote:
| Is there a way to have dump backup multiple filesystems onto a singe
| tape? In reading the man page, the only thing that resembles that
| capability is th -M option, but that doesn't appear to be what I want.
| Unless I'm misunderstanding the man page, it's not possible.
|
| Thanks,
| Tim
|

Yes. Use the non-rewinding tape device, /dev/nst0. This will write the
first dump to tape, but not rewind it when complete. Then the next dump
will begin after the end of the first dump block on tape. Repeat as
necessary. This is what I use on a Sun system using dump (slightly
modified from my xfsdump backup scripts):

#!/bin/bash
#
# Dump script for Sun E250 Syslog Server
# on ext3 filesystem, so xfsdump isn't available.
#
DATE=`date '-I'`
LEVEL=0
TAPELABEL=logger_${LEVEL}_${DATE}
TAPE=/dev/nst0
TAPEDOMAIN=logger.nmcourts.com
PARTITION1=/
PARTITION2=/boot
PARTITION3=/home
PARTITION4=/usr
PARTITION5=/var
LOG=/var/log/backups/${TAPELABEL}.log
LOG1=/var/log/backups/${TAPELABEL}.stat
TAPE_ARGS=${TAPE}
DUMP="/sbin/dump 0uzf $TAPE"
mt -f /dev/st0 rewind
if [ $? -ne 0 ]; then
~        echo 'No tape loaded or something is wrong!'> $LOG
~        /bin/mail -s "Tape not loaded - full backup of $TAPEDOMAIN
FAILED `date`" root
exit 1
fi
echo '' > $LOG1
echo '' > $LOG
echo "Backup on `date '+%D %T'` Starting" >> $LOG
echo "Backup on `date '+%D %T'` Starting" >> $LOG1
$DUMP $PARTITION1>>$LOG
if [ $? -eq 0 ]; then
~        echo "Dump of $PARTITION1 was successful" >> $LOG1
else
~        echo "Dump of $PARTITION1 FAILED!" >> $LOG1
fi
$DUMP $PARTITION2>>$LOG
if [ $? -eq 0 ]; then
~        echo "Dump of $PARTITION2 was successful" >> $LOG1
else
~        echo "Dump of $PARTITION2 FAILED!" >> $LOG1
fi
$DUMP $PARTITION3>>$LOG
if [ $? -eq 0 ]; then
~        echo "Dump of $PARTITION3 was successful" >> $LOG1
else
~        echo "Dump of $PARTITION3 FAILED!" >> $LOG1
fi
$DUMP $PARTITION4>>$LOG
if [ $? -eq 0 ]; then
~        echo "Dump of $PARTITION4 was successful" >> $LOG1
else
~        echo "Dump of $PARTITION4 FAILED!" >> $LOG1
fi
$DUMP $PARTITION5>>$LOG
if [ $? -eq 0 ]; then
~        echo "Dump of $PARTITION5 was successful" >> $LOG1
else
~        echo "Dump of $PARTITION5 FAILED!" >> $LOG1
fi
echo "Backup on `date '+%D %T'` Completed" >> $LOG
echo "Backup on `date '+%D %T'` Completed" >> $LOG1
cat $LOG1|column -tx|mail -s "Level $LEVEL backup of $TAPEDOMAIN
complete." root
rm -f $LOG.old
rm -f $LOG1.old
mv $LOG $LOG.old
- --
Andrew Mathews
- ---------------------------------------------------------------------
~  9:53am  up 2 days, 19:28, 10 users,  load average: 1.14, 1.21, 1.25
- ---------------------------------------------------------------------
Tomorrow, this will be part of the unchangeable past but fortunately,
it can still be changed today.
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org

iD8DBQE+uS2xidHQ0m/kEssRAiSfAJ9JrFx3jSXAREil6z1shTGyYqOf+wCfQe5l
pKIcHbJu2WPcc0ZqQE2IHUg=
=MKDI
-----END PGP SIGNATURE-----



More information about the Linux-users mailing list