Veritas-bu

[Veritas-bu] Capturing bpmedialist's command output ?

2005-11-02 10:02:53
Subject: [Veritas-bu] Capturing bpmedialist's command output ?
From: cballowe AT gmail DOT com (Charles Ballowe)
Date: Wed, 2 Nov 2005 10:02:53 -0500
depending on what you're doing, you may just want the output of
"bpmedialist -summary".

If you're getting your list of media from vmquery - maybe do it by
pool instead of just listing all media - you won't have an expiration
date on scratch tapes etc.

Also -- I believe you're looking at capturing stderr, not stdout. You
can have stderr go into stdout if you do:

command 2>&1

If you just want to capture stderr to a file or get rid of it:

command 2> file
(file is often /dev/null)

There's also probably a better method than calling bemedialist in your
inner loop, like capturing to a file without the -m $MEDIA_ID and
processing that for each media you want.

-Charlie

On 11/2/05, Jérôme Meyer <jerome.meyer AT pax DOT ch> wrote:
> Hi
>
> I'm writing a shell script to know the tape's expiration date, like
> this:
>
>
> VARIABLE=$(bpmedialist -mlist -U -m $MEDIA_ID|tail +7|\awk '{print
> $2}'|sed '/^ *$/d')
> Output -->  $VARIABLE=11/06/2005
>
> Unfortunately, some tapes aren't in DB and produce no output in
> $VARIABLE BUT they send this message in STDOUT like follow :
> "requested media id was not found in NB media database and/or MM volume
> database"
>
> Which commands or functions can I use to capturing the STDOUT value?
>
> Thanks
> jm
> _______________________________________________
> Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
>


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