Networker

Re: [Networker] Backup group's start/end time?

2008-02-05 00:23:26
Subject: Re: [Networker] Backup group's start/end time?
From: Tim Mooney <Tim.Mooney AT NDSU DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Mon, 4 Feb 2008 23:19:27 -0600
In regard to: [Networker] Backup group's start/end time?, rlchua said (at...:

I'm trying to create a script that will hopefully give us information on
when did a backup group started and ended. I am trying to use mminfo:

mminfo -a -q 'group=AMONTHLY,savetime>4-feb-2008' -r
'group,sscreate&#40;20&#41;,sscomp&#40;20&#41;'

but this gives me the result for each of the savesets on this group.

Because you asked for items (sscreate, sscomp) that are recorded
per-saveset, mminfo generates a saveset report.

I recommend you add the -ot flag to mminfo, and then pick the second (skip
the header) and last lines of the report, and pull the appropriate fields
out of those lines.

Alternately, if XSLT is your thing, you could add "-x m" to the mminfo
flags (likely in addtion to -ot) and then transform the resulting XML
to produce just the output you want.

Either way, post-processing of some kind is going to be the way to go.
You could do it all in a few lines of perl, or for a task like this a few
lines of shell would do the trick too:

#!/bin/sh

tmp=`mktemp /tmp/nsrgroup.XXXXXX`
mminfo -ot -x c@ -q 'group=AMONTHLY,savetime>4-feb-2008' \
        -r 'group,sscreate(20),sscomp(20)' > $tmp
first=`head -n +2 $tmp | tail -n 1 | cut -d @ -f 2`
last=`tail -n 1 $tmp | cut -d @ -f 3`
echo "Group   : AMONTHLY"
echo "Start   : $first"
echo "Finished: $last"
rm -f $tmp
exit 0

Another thing that I want to do is, on a daily basis, get a report of
what backup groups were supposed to run yesterday and its have its
completion state.

That's going to be more challenging than your first question, because it
could be very difficult to define what groups were "supposed to run".

What is much easier is getting a list of all your groups, and then finding
the "last start" and "last end" for each group, as well as the
"completion" messages for the group.  You would usr nsradmin to accomplish
that.

Tim
--
Tim Mooney                                        Tim.Mooney AT ndsu DOT edu
Information Technology Services                   (701) 231-1076 (Voice)
Room 242-J6, IACC Building                        (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

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