Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!uhccux!quonset!jwright From: jwright@cfht.hawaii.edu (Jim Wright) Newsgroups: comp.sys.hp Subject: Re: Tips for a new HP admin? (rdump/rrestore to exabyte) Keywords: HPUX 400 series Message-ID: Date: 13 Dec 90 23:58:39 GMT References: <1990Dec11.093001.25983@cs.umn.edu> Sender: news@uhccux.uhcc.Hawaii.Edu Lines: 211 lindner@cs.umn.edu (Paul Lindner) writes: >5) Will rdump/rrestore work correctly for a remote Exabyte tape drive? Here are samples of the scripts I use to backup our 300's, 400's and 800's to an Exabyte on a Sun 3/60. ---- /usr/adm/backups/remote_backup_400 ------------------------------------- #!/bin/csh # # jrw 23 oct 90 stole from script to do 300's, modified for use on 400's if ( $#argv != 0 ) then echo "usage: $0" exit (1) endif if ( `id -u` != 0 ) then echo "must be root to perform backup" exit (1) endif echo " " echo "performing backups to remote tape device" echo " " set HOST = `hostname` foreach MACHINE in ( mercury nano fireball topgun ) echo " " echo "backing up $MACHINE..." echo " " if ( "$HOST" != $MACHINE ) then remsh $MACHINE /usr/adm/backups/backup_rdump else /usr/adm/backups/backup_rdump endif end /usr/adm/backups/eject_remote exit (0) ---- /usr/adm/backups/backup_rdump ------------------------------------------ #!/bin/csh # # jrw ? created # jrw 31 may 90 modifications to work with mahina and sunos 4.1 # jrw 15 sep 90 make script which is invoked by master backup_HP script # # THIS SCRIPT MUST BE THE FIRST ONE TO WRITE TO A TAPE # This will write the first, second and third save sets to the tape. All # the other hosts' disks will come later. #### Note for usenet: Each backup_rdump script is specific to the machine #### it resides on. It has hard-coded knowledge of which save-set on the #### tape it will write. This is not bad, in that 100% consistent backups #### are good. if ( $#argv != 0 ) then echo "usage: $0" exit (1) endif if ( `id -u` != 0 ) then echo "must be root to perform backup" exit (1) endif # snag the current configuration file rcp quonset:/usr/adm/backups/config /usr/adm/backups/config set location = remote source /usr/adm/backups/config echo " " echo "performing level 0 dump on MERCURY; remote device is $rdevice" echo " " # one rewind is done asychronously, two forces a wait until completion remsh $machine /bin/mt -t $device rewind remsh $machine /bin/mt -t $device rewind # or do /bin/mt -t $device fsf N, where N is the number of this save-set # but this machine is the first in line echo "/etc/rdump $backopt $rdevice $block $density $size /dev/dsk/0s0" /etc/rdump $backopt $rdevice $block $density $size /dev/dsk/0s0 echo "/etc/rdump $backopt $rdevice $block $density $size /dev/dsk/2s0" /etc/rdump $backopt $rdevice $block $density $size /dev/dsk/2s0 echo "/etc/rdump $backopt $rdevice $block $density $size /dev/dsk/3s0" /etc/rdump $backopt $rdevice $block $density $size /dev/dsk/3s0 echo " " echo "checking dump tape for correctness" echo " " echo "retrieving file -- ignore prompts, I will provide the responses needed" cd /usr/local/cfht/backup_verify mv VerificationFile VerificationFileOrig remsh $machine /bin/mt -t $device rewind remsh $machine /bin/mt -t $device rewind cd /usr/local/cfht /etc/rrestore $restopt $rdevice $block 3 backup_verify/VerificationFile << E-O-I 1 n E-O-I echo " " echo "file retrieved, now comparing for differences" cd /usr/local/cfht/backup_verify cmp VerificationFile VerificationFileOrig echo "comparison complete" mv VerificationFileOrig VerificationFile echo " " echo "dump completed; now rewinding tape" echo " " remsh $machine /bin/mt -t $device rewind remsh $machine /bin/mt -t $device rewind exit (0) ---- /usr/adm/backups/eject_remote ------------------------------------------ #!/bin/csh # # jrw 04 oct 90 created # # Eject a remote Exabyte set location = remote source config echo " " echo "now ejecting tape" remsh $machine /bin/mt -t $device offline exit(0) ---- /usr/adm/backups/config ------------------------------------------------ #!/bin/csh # # jrw 04 oct 90 created # # This will set up the current parameters for the exabyte drive. # To use it, source this script (don't just execute it!). # # Before sourcing this script, you should have the variable $location # set to either "remote" or "local", depending on whether the exabyte # drive is locally connected or somewhere on the network. # # The master copy of this file is in quonset:/usr/adm/backups/config. # Any other machine which uses this file should always retrieve a # fresh copy from quonset before sourcing this. Only make changes # to the copy of this file on quonset. if ( "$location" == "remote" ) then ## for use with standard Sun scsi driver ## # set tape = st1 # set backopt = 0ufbds # set restopt = fbsvx # set browopt = ifs # set block = 124 # set size = 6000 # set density = 54000 ## for use with delta microsystems scsi driver on Sun ## set tape = smt0 set backopt = 0ufbs set restopt = fbsvx set browopt = ifs set block = 124 set size = 105000 set density = "" else if ( "$location" == "local" ) then ## for use with delta microsystems scsi driver on HP ## set tape = smt0 set backopt = 0fbs set restopt = fsvx set browopt = ifbs set block = 124 set size = 103400 set density = "" else echo "$0: don't know if tape drive is local or remote" set tape = "" set backopt = "" set restopt = "" set block = "" set size = "" set density = "" endif set device = /dev/nr$tape set machine = mahina set rdevice = "$machine":$device exit(0) -- Jim Wright jwright@cfht.hawaii.edu Canada-France-Hawaii Telescope Corp.