Veritas-bu

[Veritas-bu] tape eject after backup - a script that might wo rk for you too....

2000-11-30 15:52:26
Subject: [Veritas-bu] tape eject after backup - a script that might wo rk for you too....
From: David A. Chapa david AT datastaff DOT com
Date: Thu, 30 Nov 2000 12:52:26 -0800 (PST)
As they say your mileage may vary.

Could be the way the scalar interprets the -rc1 0.  Try removing that and
see if that works for you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David A. Chapa
Consulting Manager
DataStaff, Inc.
847 413 1144

On Thu, 30 Nov 2000 John_Wang AT enron DOT net wrote:

> 
> 
> Hello All
> 
> Well, it didn't quite work for me.   Even though my mail box has 18 slots, 
> when
> I do the vmchange command, it prompts me to remove the tape after each tape 
> gets
> moved to the mail slot and if I don't it will put the tape back into the 
> library
> and complain that a tape was already in the mail slot. i.e.:
> 
> #2 amazon:/ > /usr/openv/volmgr/bin/vmchange -vh amazon -res -m 000189 -mt 8mm
> -rt none -rc1 0 -e ; /usr/openv/volmgr/bin/vmchange -vh amazon -res -m 000192
> -mt 8mm -rt none -rc1 0 -e ; /usr/openv/volmgr/bin/vmchange -vh amazon -res -m
> 000041 -mt 8mm -rt none -rc1 0 -e
> 
>         remove 000189 from mailslot of robot 0 now
> 
>         remove 000189 from mailslot of robot 0 now
>         (press <RETURN> to continue)
> 
> 
> 
>         remove 000192 from mailslot of robot 0 now
> 
>         remove 000192 from mailslot of robot 0 now
>         (press <RETURN> to continue)
> 
> 
> 
>         remove 000041 from mailslot of robot 0 now
> 
>         remove 000041 from mailslot of robot 0 now
>         (press <RETURN> to continue)
> 
> 
> Any ideas as to why it's still doing the tapes one at a time?   The robot is 
> an
> ADIC Scalar 1000.
> 
> Regards,
> John I Wang
> Sr. Systems Engineer
> Steverson Information Professionals
> 
> ---
> Enron Broadband Services
> Enron Building 1472c
> ph (713) 345-4291
> fax (713) 646-8063
> 
> 
> |--------+----------------------->
> |        |          DONALDG AT tc DOT gc|
> |        |          .ca          |
> |        |                       |
> |        |          11/29/00     |
> |        |          08:31 AM     |
> |        |                       |
> |--------+----------------------->
>   >-----------------------------------------------------------------------|
>   |                                                                       |
>   |       To:     veritas-bu AT mailman.eng.auburn DOT edu                    
>    |
>   |       cc:     shyamdayal AT usa DOT net, (bcc: John Wang/Contractor/Enron 
>    |
>   |       Communications)                                                 |
>   |       Subject:     RE: [Veritas-bu] tape eject after backup - a script|
>   |       that might wo     rk for you too....                            |
>   >-----------------------------------------------------------------------|
> 
> 
> 
> Greetings!
> 
>            This e-mail is for those of you who are tired of ejecting one tape
> at a time out of your tape libraries with the Veritas Media Manager GUI
> (v3.2)interface and don't have your own script. We made this script because
> we have to do a lot of ejecting of active backup tapes(copy 1) out of our
> tape library in order to make room for the next weekend's full backups and
> duplication run.  If this doesn't apply to you, please ignore the
> following......
> 
>            An e-mail from David A. Chappa (November 14, 2000 9:00AM) on how to
> utilize the vmchange command to eject tapes out of the silo via the
> undocumented "-e" parameter (thank you David!) inspired me to have the
> following script put together. It allows you to eject media that are in the
> silo to the CAP/outport (we are using a STK 9740 Tape Library) that fall
> within the date and time range that you specify.  Since we only have a 14
> slot CAP, it stops after the 14th eject and prompts you to clear the CAP and
> press a key to continue with the next 14, and so on.
> 
>            Please note the following regarding the script:
> 
> - It is intended to be used after you have already ejected your duplicate
> tapes out of the silo for the date range that you are specifying. This is
> because it doesn't differentiate between tape pools and you may
> inadvertently eject your duplicate tapes that you normally use a product
> such as Veritas' BpVault to autoeject.  I couldn't figure out how to specify
> what pool of tapes to use, so if anyone has any suggestions please let me
> know.
> 
> -It assumes that a Volume Group value of "00_000_TLD" is assigned to those
> media that are currently located in the silo.
> 
> Grant
> 
> 
> #!/bin/sh
> 
> MEDIAINSILO="/tmp/mediainsilo"
> NBDUPLICATES="/tmp/nbduplicates"
> #First read in the required parameters:
> 
> VALIDDATES=true
> while  $VALIDDATES
> do
> echo "Please enter the start date in the form mm/dd/yy"
> read STARTDATE
> echo "\nPlease enter the start time in the form hh:mm:ss"
> read STARTTIME
> echo "\nPlease enter the end date in the form mm/dd/yy"
> read ENDDATE
> echo "\nPlease enter the end time in the form hh:mm:ss"
> read ENDTIME
> if [ "{STARTDATE:=NULL}" = "NULL" -o "{STARTTIME:=NULL}" = "NULL" -o
> "{ENDDATE:=NULL}" = "NULL"  -o "{ENDTIME:=NULL}" = "NULL" ]
> then
> echo "Illegal parameter(s) entered"
> else
> VALIDDATES=false
> echo "You want start date/time = $STARTDATE $STARTTIME and end date/time =
> $ENDDATE $ENDTIME"
> echo "Is this correct (y/n)"
> read yn
> if [ "{yn:=NULL}" = "NULL" -o "$yn" = "y" -o "$yn" = "Y" ]
> then
> VALIDDATES=false
> else
> VALIDDATES=true
> fi
> fi
> done
> 
> #Get a list of media to be ejected
> DESIREDMEDIA=`/usr/openv/netbackup/bin/admincmd/bpimagelist -media -idonly
> -d $STARTDATE $STARTTIME  -e $ENDDATE $ENDTIME | sort`
> 
> if [ "{DESIREDMEDIA:=NULL}" = "NULL" ]
> then
> echo "No media to be ejected that meet the criteria"
> exit 9
> fi
> 
> /usr/openv/volmgr/bin/vmquery -v 00_000_TLD -b | grep TLD | awk '{ print $1
> }' | sort > $MEDIAINSILO
> 
> /usr/openv/volmgr/bin/vmquery -b -pn NB_Duplicates | grep TLD | awk '{ print
> $1 }' | sort > $NBDUPLICATES
> 
> 
> comm -3 $MEDIAINSILO $NBDUPLICATES > $MEDIAINSILO.1
> mv $MEDIAINSILO.1 $MEDIAINSILO
> for MEDIA in $DESIREDMEDIA
> do
> # first search
> TEST=`grep -c $MEDIA $MEDIAINSILO`
> 
> if [ "$TEST" = "0" ]
> then
>            # desired media is not in the silo
>            echo "$MEDIA - Desired Media is not in silo"
> else
> #          echo $MEDIA
>            /usr/openv/volmgr/bin/vmchange -vh tcstor1 -res -m $MEDIA -mt HCART
> -rt none -rc1 0 -e
>            RETCODE=$?
>            if [ "$RETCODE" = "221" ]
>            then
>                      # CAPS are full request user intervention
>                      echo "ATTENTION: CAPS are full - please empty and press
> [ENTER] to continue"
>                      read dummy
>                      /usr/openv/volmgr/bin/vmchange -vh tcstor1 -res -m $MEDIA
> -mt HCART -rt none -rc1 0 -e
>            fi
> fi
> done
> 
> echo "All done"
> 
> 
> 
> 
> 
>            A portion of David's e-mail:
> 
> > ----------
> > From:         David A. Chapa[SMTP:david AT datastaff DOT com]
> > Sent:         November 14, 2000 9:00 AM
> > To:           shyam hazari; veritas-bu AT mailman.eng.auburn DOT edu
> > Subject:           RE: [Veritas-bu] tape eject after backup
> >
> >
> >
>            "Here what I want to do is to eject the tape out
> > of the tape drive to the outport. How do I achieve this ?"
> >
> > !>>/usr/openv/volmgr/bin/vmchange -vh $MASTER -res -m $MEDIAID \
> > !>>    -mt $DENSITY -rt none -rc1 0 -rc2 0 [ -v $volume_group ] -e
> >
> > /usr/openv/volmgr/bin/vmchange -vh tcstor1 -res -m xxxxx -mt hcart -rt
> > none -rc1 0 -v 00_000_TLD -e
> >
> >
> > _______________________________________________
> > Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> > http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
> >
> _______________________________________________
> Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
> 
> 
> 
> 
> _______________________________________________
> Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
>