Veritas-bu

[Veritas-bu] Ejecting several tapes at once from CLI

2001-03-20 12:34:19
Subject: [Veritas-bu] Ejecting several tapes at once from CLI
From: ll AT bellglobal DOT com (Luc Lamer)
Date: Tue, 20 Mar 2001 12:34:19 -0500
Here you go:

#!/bin/sh
#
# File: tpeject
# Author: Ryan Anderson (from Blayne Puklich)
# Creation date: 2000-09-14
# Time-stamp: " "
#
# Description
#   Eject a tape media id (EVSN)
#   Ejects media IDs passed as parameters; if there
#   are no parameters reads STDIN.
#
# $Log: tpeject,v $
# Revision 1.1  2000/12/28 16:40:26  andersrc
# Initial revision
#
#

PATH=/usr/openv/volmgr/bin/admincmd:/usr/openv/netbackup/bin
PATH=$PATH:/usr/openv/volmgr/bin:/usr/local/bin:/usr/sbin:/usr/bin
VMCHANGE=/usr/openv/volmgr/bin/vmchange
export PATH VMCHANGE

gMe=`basename $0 .sh`

#
# Eject the media ID(s) given to us.
eject_tp() # media_id
{
        $VMCHANGE -res -m $1 -mt dlt -e
        echo "Ejected DLT with media ID $1 to mailslot."
}

if [ $# -gt 0 ]; then
    #
    # Eject all tapes passed on command line
    for tpid in $*; do
        eject_tp $tpid
    done
else
    #
    # eject all tapes passed on stdin
    while read tpid; do
        eject_tp $tpid
    done
fi
exit 0

Thanks

Luc

> -----Original Message-----
> From: veritas-bu-admin AT mailman.eng.auburn DOT edu
> [mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu]On Behalf Of Monica
> Hanna
> Sent: Tuesday, March 20, 2001 12:22 PM
> To: 'Jeff Kennedy'; Veritas-bu List
> Subject: RE: [Veritas-bu] Ejecting several tapes at once from CLI
> 
> 
> Hi,
> 
> Would it be possible to get a copy of the tpeject script?
> Thanks.
> 
> Monica Hanna
> Stack Computer, Inc.
> 3199-D Airport Loop Drive
> Costa Mesa, CA 92626
> www.stackcomputer.com
> 
> 
> -----Original Message-----
> From: Jeff Kennedy [mailto:jlkennedy AT amcc DOT com]
> Sent: Friday, March 16, 2001 5:02 PM
> To: Veritas-bu List
> Subject: Re: [Veritas-bu] Ejecting several tapes at once from CLI
> 
> 
> So I've tried the tpeject script and I like it.  I have one issue
> regarding it though; it asks for a <return> after each volume is
> ejected.  Is this required for it to work?  Does it simply eject all of
> the tapes whether or not I enter a carriage return?
> 
> Thanks.
> 
> ~JK
> 
> Steve White wrote:
> > 
> > This one automatically updates NetBackup because it uses "vmchange".  You
> > would have to update the NetBackup information using "vmupdate" if you
> have
> > used something like "tldtest" to eject tapes, which some folks do.
> > 
> > Steve
> > 
> > > -----Original Message-----
> > > From: veritas-bu-admin AT Eng.Auburn DOT EDU
> > > [mailto:veritas-bu-admin AT Eng.Auburn DOT EDU]On Behalf Of Jeff Kennedy
> > > Sent: Tuesday, March 13, 2001 6:41 PM
> > > To: Veritas-bu List
> > > Subject: Re: [Veritas-bu] Ejecting several tapes at once from CLI
> > >
> > >
> > > Does this update NetBackup as well or just move the tapes requiring a
> > > media update afterwards?
> > >
> > > ~JK
> > >
> > > Steve White wrote:
> > > >
> > > > Here's an E-mail (with a script attached) from a previous thread on
> this
> > > > list about the same thing...the script should work nicely for you.
> > > >
> > > > Steve
> 
> -- 
> =====================
> Jeff Kennedy
> Unix Administrator
> AMCC
> jlkennedy AT amcc DOT com
> _______________________________________________
> 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
>