#!/bin/csh -f # file://dumpalone # # Performs full level 0 backup of all mounted slices. # The TAPE environment variable is used as the tape device. # If the TAPE variable is not set then /dev/rmt/0n is used. # # # Modification Log: # # Name Date Why # ---- ---- --- # Kevin Inscoe (kevin@inscoe.org) 12/26/97 Created orginal # # # Set environment and global variables # set ver = "1.0" setenv DUMPOPS "ul0bf 126" set order = "/tmp/dumped.order" # # Announce ourselves # echo " " echo "DumpAlone version" $ver echo " " # # Determine host being dumped, host being dumpted to and determine tape device # if ( $2 == "" ) then if ( $?TAPE ) then setenv TAPEDEV $TAPE else setenv TAPEDEV "/dev/rmt/0mn" endif else if ( `echo $2 | grep ":" | wc -l` == 0 ) then echo "dumpalone: missing tape device" exit 1 endif endif # # Now find all mounted partitions # echo "Checking for filesystems ..." set mount = `df -ln | grep ufs | cut -f1 -d:` # # Now build file dumped.order # and tar it to the tape as the second file # if ( -e $order ) /bin/rm -f $order /bin/touch $order /bin/echo "Dumped by DumpAlone" $ver "on" `date` >> $order @ count = 2 foreach fs ( $mount ) @ count = $count + 1 /bin/echo $count $fs >> $order end # # Start the backup # echo " " echo " *** Backup - Level 0 ***" echo " " echo '--- REWINDING tape ---' (mt -f $TAPEDEV rew) echo '--- TARing scriptfile ---' (/bin/tar cvf $TAPEDEV $0) (mt -f $TAPEDEV eom) echo '--- TARing dumporder ---' (/bin/tar cvf $TAPEDEV $order) foreach filesystem ( $mount ) echo '--- Dumping $filesystem to tape ---' (/usr/sbin/ufsdump ${DUMPOPS} ${TAPEDEV} $filesystem) end # # rewind and offline the tape and clean up # /bin/rm -f $order (echo '--- REWINDING tape --- ') (mt -f ${TAPEDEV} rew) (mt -f $TAPEDEV off)