Networker

Re: [Networker] mminfo not equal query

2004-04-06 21:05:15
Subject: Re: [Networker] mminfo not equal query
From: "Sakowski, Aaron -Cons A" <aaron-cons.a.sakowski AT PFIZER DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Tue, 6 Apr 2004 21:04:49 -0400
I was having the problem of pool names with spaces too until a friend of
mine showed me the pack/unpack funtions in perl.  I have a sample below:

## the $TEMPLATE variable is used to define the field (ascii character)
width
my $TEMPLATE = 'a7a8a10a15a8a60a12';
## @lines is the lines containing slot information from an nsrjb -Cv
foreach (@lines) {
## seperate the value:  field 1 - 7 ascii chars wide, field 2 - 8 ascii
chars wide, etc...
    my @l = unpack($TEMPLATE, $_);
## @l[0] is the slot number.  I use this as the hash identifier
    $ID=@l[0];
    $ID =~ s/://;
    shift @l;
## assign all the fields to a hash variable
    @{ $SLOT_INFO{$ID} }{qw(VOL USED POOL BARCODE VOLID STATE)}=@l;
}


This doesn't fix the fact that mminfo doesn't understand pool!="Offsite
Clone", but it has saved me a lot of silly grep -v or sed -e 's/
Clone/_Clone/' work from inside my perl scripts.


-----Original Message-----
From: Legato NetWorker discussion
[mailto:NETWORKER AT LISTMAIL.TEMPLE DOT EDU]On Behalf Of Davina Treiber
Sent: Tuesday, April 06, 2004 2:32 PM
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Subject: Re: [Networker] mminfo not equal query


Faidherbe, Thierry wrote:
> Without any reporting param, mminfo provides lastest 24 hours
> backups, including volume, client, date, size, level and name.
>
> So why not just reformulate mminfo query like :
>
> mminfo -r pool,volume,client,sscreate,totalsize,level,name
> and then grep-exclude pool you do not need ?
>
>
> mminfo -r pool,volume,client,sscreate,totalsize,\
>    level,name |grep -v "^<past poolname here>"

Well I could do it that way but there are complications. It's in a perl
script for a start. Piping the command into a grep is a bit messy,
although I could let perl do the filtering ( next if /Offsite/; ). Also,
some of my pool names have spaces in them. Yes I know that's poor style
but the spaces were there before I arrived. On top of that the query
will contain another field with spaces in - the save set name. So my
current code that does something like:

($nsavetime,$level,$totalsize,@name) = split;

will have to become a bit more complicated if the pool is in there too.

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

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