Re: amverify only on most recent set

2002-09-12 Thread Jean-Louis Martineau

Hi Andrew,

I include a patch to amverify that add a third argument, the number of tape
you want to verify, it will take runtapes if the argument is absent.

I also include a new program (amverifyrun) which verify the tape
written in the latest run (amdump or amflush), this script grep
the log file to find the first slot to verify and the number of
tape use, it then call amverify with the appropriate parameters.

The third attachment is a patch for configure and Makefile to compile
and install amverifyrun.

I only did a few test, I'm using runtapes=1. Could you test it and
tell me if it works in your configuration.

Jean-Louis

On Wed, Sep 11, 2002 at 08:33:16AM -0700, Andrew Williams wrote:
> Is there a way to get amverify to only check tapes from the most recently
> completed backup?  I currently have runtapes set to 3 (to allow for new hosts
> I'm going to be adding in the next few weeks) however the current backup only
> takes one tape.  amverify is currently scanning it's 3rd tape (from a backup 2
> days ago)  This takes a ton of time to scan tapes that have already been
> scanned.  Any way around this other than writing a script to check the output
> of amtape show and run amverify per slot on the newest tapes only?  Also, if
> you specify a slot with amverify does it then ignore the runtapes option?
> 
> - andrew
> 
> __
> Yahoo! - We Remember
> 9-11: A tribute to the more than 3,000 lives lost
> http://dir.remember.yahoo.com/tribute

-- 
Jean-Louis Martineau email: [EMAIL PROTECTED] 
Departement IRO, Universite de Montreal
C.P. 6128, Succ. CENTRE-VILLETel: (514) 343-6111 ext. 3529
Montreal, Canada, H3C 3J7Fax: (514) 343-5834


diff -u -r --show-c-function --exclude-from=amanda.diff 
amanda-2.4.3b4.orig/server-src/amverify.sh.in 
amanda-2.4.3b4.new/server-src/amverify.sh.in
--- amanda-2.4.3b4.orig/server-src/amverify.sh.in   Thu Sep 12 15:05:31 2002
+++ amanda-2.4.3b4.new/server-src/amverify.sh.inThu Sep 12 15:26:03 2002
@@ -269,7 +269,7 @@ if [ X"$TPCHANGER" = X"" ]; then
 else
CHANGER_SLOT=${2:-current}
$Echoe "Tape changer is $TPCHANGER..."
-   SLOTS=`getparm runtapes`
+   SLOTS=${3:-`getparm runtapes`}
[ X"$SLOTS" = X"" ] && SLOTS=1
if [ $SLOTS -eq 1 ]; then
p=""


#!/bin/sh
#

prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@
libexecdir=@libexecdir@

PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
export PATH

USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
if [ "$USE_VERSION_SUFFIXES" = "yes" ]; then
SUF="-@VERSION@"
else
SUF=
fi

getparm() {
$AMGETCONF $CONFIG $1 2>/dev/null | grep -v BUGGY
}

CONFIG=$1
libexecdir=$libexecdir  
sbindir=$sbindir
AMGETCONF=$sbindir/amgetconf$SUF
AMVERIFY=$sbindir/amverify$SUF
LOGDIR=`getparm logdir`
AMDUMPLOG=${LOGDIR}/amdump.1
AMFLUSHLOG=${LOGDIR}/amflush.1
if [ -e $AMDUMPLOG ]; then
  if [ -e $AMFLUSHLOG ]; then
if [ $AMDUMPLOG -nt $AMFLUSHLOG ]; then
  AMLOG=$AMDUMPLOG
else
  AMLOG=$AMFLUSHLOG
fi
  else
AMLOG=$AMDUMPLOG
  fi
else
  if [ -e $AMFLUSHLOG ]; then
AMLOG=$AMFLUSHLOG
  else
echo "Nothing to verify"
exit 1;
  fi
fi


FIRST_SLOT=`grep "taper: slot" $AMLOG | sed 1q | sed 's/://g' | awk '{print $3}'`

NBTAPES=`grep -c "taper: wrote label " $AMLOG`

$AMVERIFY $CONFIG $FIRST_SLOT $NBTAPES


diff -u -r --show-c-function --exclude-from=amanda.diff 
amanda-2.4.3b4.orig/configure.in amanda-2.4.3b4.new/configure.in
--- amanda-2.4.3b4.orig/configure.inFri Sep  6 10:00:39 2002
+++ amanda-2.4.3b4.new/configure.in Thu Sep 12 14:28:44 2002
@@ -2720,6 +2720,7 @@ AC_OUTPUT( \
server-src/amoverview.plserver-src/amrmtape.sh  \
server-src/amtoc.pl server-src/amverify.sh  \
server-src/Makefile server-src/amstatus.pl  \
+   server-src/amverifyrun.sh   \
\
tape-src/Makefile   \
\
diff -u -r --show-c-function --exclude-from=amanda.diff 
amanda-2.4.3b4.orig/server-src/Makefile.am amanda-2.4.3b4.new/server-src/Makefile.am
--- amanda-2.4.3b4.orig/server-src/Makefile.am  Sun Mar 24 18:06:44 2002
+++ amanda-2.4.3b4.new/server-src/Makefile.am   Thu Sep 12 14:25:09 2002
@@ -27,7 +27,7 @@ libexec_PROGRAMS =amindexdamlogroll   am
 
 sbin_SCRIPTS = amcheckdb   amcleanup   amdump  \
amoverview  amrmtapeamtoc   \
-   amverifyamstatus
+   amverifyamverifyrun amstatus
 
 libamserver_la_SOURCES=amindex.c   changer.c   \
conffile.c  diskfile.c  

amverify only on most recent set

2002-09-11 Thread Andrew Williams

Is there a way to get amverify to only check tapes from the most recently
completed backup?  I currently have runtapes set to 3 (to allow for new hosts
I'm going to be adding in the next few weeks) however the current backup only
takes one tape.  amverify is currently scanning it's 3rd tape (from a backup 2
days ago)  This takes a ton of time to scan tapes that have already been
scanned.  Any way around this other than writing a script to check the output
of amtape show and run amverify per slot on the newest tapes only?  Also, if
you specify a slot with amverify does it then ignore the runtapes option?

- andrew

__
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute