Networker

Re: [Networker] saveset Full dump query using mminfo or ???

2002-09-12 11:32:19
Subject: Re: [Networker] saveset Full dump query using mminfo or ???
From: Davina Treiber <treiber AT HOTPOP DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Thu, 12 Sep 2002 11:32:16 -0400
On Thu, 12 Sep 2002 08:12:44 -0400, Matt Divens <divens AT STSCI DOT EDU> wrote:

>   I'm trying to find a fast, efficient way to quesry the networker
database
>and get a report of all savesets that have NOT had a full dump in the past
5
>weeks.  I assume mminfo would give this to me, but I am having trouble
>getting the query right. Does anyone have input on this?

I don't think there's a single query you could run to give this
information, anything you do would need further processing. I wrote a
script recently to list the most recent instance of every save set in the
media DB. This might be useful to you so that you could then pick out any
dates more than 5 weeks ago. I will post the script here, but warn you that
it is a bit rough and ready, with no comments, and not particularly well
tested yet. Here it is:

#!/app/bin/perl

# show_latest_full

open MMINFO, "mminfo -a |";
while (<MMINFO>) {
        ($vol, $client, $savetimeraw, undef, undef, $level, @name) = split;
        $name = join "sPaCe", @name;
        $_ = $savetimeraw;
        ($mm, $dd, $yy) = split /\//;
        $savetime = "$yy/$mm/$dd";
        if ($level eq "full") {
                if (defined $latestsavetime{$client}{$name}) {
                        $l_savetime = $latestsavetime{$client}{$name};
                        if ($savetime gt $l_savetime) {
#                               print "old = $l_savetime, new =
$savetime\n";
                                $latestsavetime{$client}{$name} = $savetime;
                                $latestvol{$client}{$name} = $vol;
                        }
                        else {
#                               print "not replacing $l_savetime with
$savetime\n";
                        };
                }
                else {
#                       print "new = $savetime\n";
                        $latestsavetime{$client}{$name} = $savetime;
                        $latestvol{$client}{$name} = $vol;
                };
        };
};

for $client (sort keys %latestsavetime) {
        for $name (sort keys %{ $latestsavetime{$client} } ) {
                $rightname = $name;
                $rightname =~ s/sPaCe/ /g ;
                printf "%-15s%-40s%-11s%-20s\n", $client, $rightname,
$latestsavetime{$client}{$name}, $latestvol{$client}{$name};
        };
};

--
Note: To sign off this list, send a "signoff" 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.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=