Networker

Re: [Networker] id the latest "full"

2002-12-12 11:02:36
Subject: Re: [Networker] id the latest "full"
From: Davina Treiber <treiber AT HOTPOP DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Thu, 12 Dec 2002 11:03:02 -0500
On Thu, 12 Dec 2002 10:52:38 -0500, Bob Kryger <bobk AT PANIX DOT COM> wrote:

>I am trying to use mminfo to find the most recent full save set for
>particular clients. So far all I can get is all the savesets after or
>between some date(s), but for some clients that might include fulls from
>multiple days (runs).
>
>Before I write a script to do this I was wondering if there were any other
>suggestions.

You're in luck, I've already written a script to do this. Voici...


#!/usr/bin/perl

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.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

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