Networker

Re: [Networker] vaulting tapes

2005-12-01 10:33:12
Subject: Re: [Networker] vaulting tapes
From: Vernon Harris <harriv00 AT YAHOO DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 1 Dec 2005 07:31:04 -0800
thanks very very much!!!

--- Charles Heynig <charles.heynig AT WMICH DOT EDU> wrote:

> #!/usr/bin/ksh
> # offsite_tapes.sh
> # Charles Heynig
> # Created 2003-09-15
> #
> # unmount tapes and withdraw to export ports
> #
> NSR_HOME=/nsr
> 
> PATH=${PATH}:/nsr/sbin/nsr:/nsr/bin/nsr
> export PATH
> 
> # List of tapes going offiste
> TAPE_OUT=${NSR_HOME}/tmp/tape.out
> 
> # Generate a list of tapes to go offsite from last
> weekends backups
> mminfo -a -t "48 hours ago" -q "pool=LTOPool,
> location=barney" -r \
>        "volume"| awk '{ print $1 }' > ${TAPE_OUT}
> 
> 
> # E-mail outfile to backup-admin
> date > ${NSR_HOME}/tmp/date.out
> cat ${NSR_HOME}/tmp/date.out ${TAPE_OUT} |
> /usr/ucb/mail -s "offsite \
>        tape list" backup-admin AT schmoe DOT com
> 
> 
> # Get number of tapes in the offsite list
> TAPECOUNT=`wc -l ${TAPE_OUT} | awk '{ print $1 }'`
> 
> # Count of how many tapes are in the export cap
> EXPORTCOUNT=1
> 
> # Counter for what is the next line to get from the
> export list
> CURRENTTAPE=1
> 
> while [[  $TAPECOUNT -gt 0 ]]; do
> 
>         # Read one line from the tape list
>         TAPE=`sed -n ${CURRENTTAPE},${CURRENTTAPE}p
> ${TAPE_OUT}`
>         print "Exporting tape: $TAPE"
> 
>         # Unmount the tape from the drive
>       # Works wether tape is mounted or not
>         nsrjb -u $TAPE
> 
>         # Mark the tape readonly
>         nsrjb -Y -o readonly $TAPE
> 
>         # Withdraw the tape to the export cap
>         nsrjb -w $TAPE
> 
>         # Change the tape location to offsite
>         mmlocate -n $TAPE -u offsite
> 
>         (( EXPORTCOUNT+=1 ))
>         if [[ $EXPORTCOUNT -eq 21 ]]; then
>                 print " "
>                 print "Please remove the tapes from
> the export cap"
>                 read REPLY?"Hit <Enter> to continue:
> "
>                 print ""
>                 EXPORTCOUNT=1
>         fi
> 
>         (( TAPECOUNT-=1 ))
>         (( CURRENTTAPE+=1 ))
> done
> 
>  print "Please remove the tapes from the export cap"
> 
> exit
> 
> 
> > On Wed, 30 Nov 2005 03:32:42 -0800, Vernon Harris
> <harriv00 AT YAHOO DOT COM> wrote:
> > 
> > >For you out there that have to eject tapes out of
> your
> > >library each day and send them offsite.  Have you
> > >automated this process?? If so how???
> > >
> > >Thanks
> 
> To sign off this list, send email to
> listserv AT listserv.temple DOT edu and type "signoff
> networker" in the
> body of the email. Please write to
> networker-request AT listserv.temple DOT edu if you have
> any problems
> wit this list. You can access the archives at
> http://listserv.temple.edu/archives/networker.html
> or
> via RSS at
>
http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
> 

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu 
if you have any problems
wit this list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>