Re: ejecting amanda tape - after dump finishes

2000-11-17 Thread Johannes Niess

Denise Ives [EMAIL PROTECTED] writes:

 Can Amanda be configured to automatically eject the tape from the tape
 drive when a dump to tape is finished? 
 
 Or should I write a perl or shell script to automate the both the dump and
 eject tape process?

I do it via crontab:

... nice /path/amdump config; /path/mtst -f /dev/nst0 rewoffl

Does amanda support error levels to do amdump  mtst ?

Johannes Niess



Re: ejecting amanda tape - after dump finishes

2000-11-17 Thread stanonik

On Fri, 17 Nov 2000, Denise Ives wrote:
 Can Amanda be configured to automatically eject the tape from the tape
 drive when a dump to tape is finished? 

When I had only one tape drive, I ran a script which contained

amdump $config
amtape $config eject

(I don't remember who suggested it to me, but thanks!)

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 modified the script.

amdump $config

amtape $config slot 1
amtape $config eject
amtape $config slot 2
amtape $config eject

Each day I still need to figure out if a tape wasn't
used and needs to be reloaded.

I resisted writing a perl script to handle ejecting
because I was concerned about keeping the list of tape
drives up-to-date in both amanda and the perl script.
Yes, the drives don't change often, so that was probably
a silly concern.  perl could probably figure out which
tape shouldn't be ejected from a combination of "amadmin tape"
and "amtape show".  Then, maybe, I could turn the daily tape
handling over to someone else, who only had to insert the
next available tape(s) in the available drive(s).

Ron
[EMAIL PROTECTED]




Re: ejecting amanda tape - after dump finishes

2000-11-17 Thread Paul Lussier

In a message dated: Fri, 17 Nov 2000 15:48:40 GMT
Denise Ives said:

Can Amanda be configured to automatically eject the tape from the tape
drive when a dump to tape is finished? 

Well, there's not much to it, in amanda's crontab entry, just do something
like:

55 23 * * 0 amdump DailySet1  amtape DailySet1 eject
or
55 23 * * 0 amdump DailySet1;amtape DailySet1 eject

Or should I write a perl or shell script to automate the both the dump and
eject tape process?

This is also a perfectly viable option.  Personally, I like simplicity, so I'd 
probably opt for one of the above methods.  But, as Dave W. pointed out,
if you use an autochanger, you can just run amcheck right after the dump is 
done, and this will accomplish the same thing.

The way I handle it with my autochanger is to set up crontab entries for
each day of the week to run 'amtape config slot #' to make sure the correct 
slot is loaded each day.  A little verbose, and probably better handled
with a script, but it works:

45 23 * * 1 amtape DailySet1 slot 1

This runs 10 minutes before amdump runs.  I have one for each day of the week.
I did it this way so that it was obvious to anyone else what was going on.
I may place it all in one script and exec that instead, but either way works 
just fine.

-- 
Seeya,
Paul

   I'm in shape, my shape just happens to be pear!

 If you're not having fun, you're not doing it right!





Re: ejecting amanda tape - after dump finishes

2000-11-17 Thread John R. Jackson

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]