>Now I have two drives configured as chg-multi, but
>sometimes backups only require one tape.  amtape doesn't
>know how many tapes were used.  ...

I also use a script around amdump (et al) and just run that from cron.
It's available at:

  ftp://gandalf.cc.purdue.edu/pub/amanda/run-amanda

if anyone wants it for a starting point.  The above is for 2.4.2.
There is also run-amanda-2.4.1 there for that release.

Among other things, it runs amtoc.  Prior to 2.4.2, it needed to know
how many tapes were used during this run, ala the need for you to know
how many tapes to eject.  The technique I used was to copy the tapelist
file before the run (actually, I copy all the config files before the
run "just in case") and diff it with the one after.  The following is
ksh code, adjust as needed for your shell, and tapelist.0 is the file
at the start of the run:

  diff tapelist.0 tapelist \
    | grep '^> ' \
    | while read flag date label junk
  do
     print "$(ts) Creating TOC for $label"
     ${DEBUG} $base/sbin/amtoc ${config} -f -l $label
  done

If you just want to know how many tapes were used, this should do it:

  numtapes=$(diff tapelist.0 tapelist | grep '^> ' | wc -l)

>Ron

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]

Reply via email to