Networker

Re: [Networker] Need list of tapes sorted by oldest saveset

2007-12-18 11:23:27
Subject: Re: [Networker] Need list of tapes sorted by oldest saveset
From: A Darren Dunham <ddunham AT TAOS DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Tue, 18 Dec 2007 16:19:20 +0000
On Tue, Dec 18, 2007 at 08:28:05AM -0500, Stan Horwitz wrote:
> The man page for mminfo isn't helping me determine how to get a report  
> I need out of mminfo. I need a list of tapes with volume name, the  
> date of the oldest saveset, and the tape's location. If anyone knows  
> how to get that sort of report out of mminfo, please let me know.  
> Thanks.

If you ask for saveset information (like savetime), you'll get a report
on savesets, not volumes.  Sometimes that's what I want and I
post-process it with a script to find the oldest (or youngest or
whatever) item on the volume.

The only items you can get in a per-volume report are the items at the
top of the list of mminfo fields up until the first blank line.  None of
them appear to be useful as a "oldest saveset" measure.

In some environments the 'labeled' time would be good enough.  But in
others where tapes are pre-labled ahead of time, the gap would be
significant.

Otherwise something like this might be pretty close:

$ mminfo -av -r 'volume,nsavetime,location' | perl -lane 'if (!exists 
$time{$F[0]} or $time{$F[0]}>$F[1]) {$time{$F[0]}=$F[1]};$loc{$F[0]}=$F[2]; 
END{for(sort keys %time){print "$_ ",scalar localtime $time{$_}, " $loc{$_}"}}'

-- 
Darren Dunham                                           ddunham AT taos DOT com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

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