Re: [Networker] Finding a tape
2006-08-03 18:29:19
On Wed, Aug 02, 2006 at 08:33:45AM -0700, Brett Monroe wrote:
> I have a script that is fired off by a savegroup compleation notification
> and within it, I would like to deturmine the volumes used by said savegroup
> (and only said savegroup).
I don't worry about tying it to a specifcc save group, but I am
interested in what volumes have changed in the last day. Here's an
example of a report I run daily:
-- CUT mmchange.sh --
#! /bin/sh
date=`date +%d`
cd /usr/dcs/backups/mmreport
/usr/sbin/mminfo -m -s YOURSERVER > new.txt
/usr/sbin/mmlocate -s YOURSERVER >> new.txt
diff orig.txt new.txt > diff.txt
result=$?
if [ $result -eq 0 ]; then
rm new.txt
rm diff.txt
echo "$date report is the same" >> log.txt
exit;
fi
echo "$date new info! mailing mussulma" >> log.txt
echo "New mm info:" > mail.txt
echo "Diff is:" >> mail.txt
cat diff.txt >> mail.txt
echo >> mail.txt
cat new.txt >> mail.txt
cat mail.txt | mailx -s "[DCS-backups] media diff report" YOUREMAIL
mv orig.txt $date-orig.txt
mv new.txt orig.txt
rm diff.txt
-- CUT HERE --
Replacing the YOUR stuff with your environment. The nice part about the
report is the diff at the top -- it quickly tells you what's changed
media-wise since the last time it was run. It also includes the full
media report (2959 lines -- do I really have that many tapes?) and
location report in the email for reference.
It's also one way to see if restores were done, (which isn't logged too
well in Networker.) With this script, you'll see the read and mounts
increase when a restore is triggered.
Not really what you asked for, but you might be able to tweak it to be
timed based, as others have mentioned here to limit to changes just in
the time that specific savegroup was running.
Dave
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
wit 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
|
|
|