On Wednesday 17 March 2004 03:24, Paul Bijnens wrote: >Gene Heskett wrote: >> On Tuesday 16 March 2004 16:46, jlm17 wrote: >>>I have a question about the name of the log file generated by >>>amdump. So the format is log.date.number, where number starts at >>> 0. If I run two amdumps in one day, would log.date.0 be the log >>> file for the first amdump to start, or the first amdump to >>> finish? > >... > >> Amdump will mail you a report if properly configured, why not use >> that one? > >You took the words right out of my mouth :-) > >But if you want to do something else with the log file, like feeding >it to amtoc, then you do need to know which log file is the good > one. My cron executes following script each night. It runs amtoc > on the right logfile, and ejects from my chg-multi drives with 2 > tapes the tapes that were written. (change the pathnames in the > script!) > >-------------------cut----------- >#!/bin/sh > >CONFIG=$1 > >/opt/local/sbin/amdump $CONFIG >LOGF=`ls -t /var/opt/amanda/$CONFIG/log.2* | head -1` >/opt/local/sbin/amtoc -a -t $LOGF > >grep '^START taper .* label ' $LOGF | >while read line >do > /opt/local/sbin/amtape $CONFIG eject > /opt/local/sbin/amtape $CONFIG slot prev >done >-------------------cut-----------
What can I say, thats neat. Mine of course cannot eject the used tapes by any method except handling the magazine. -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) 99.22% setiathome rank, not too shabby for a WV hillbilly Yahoo.com attornies please note, additions to this message by Gene Heskett are: Copyright 2004 by Maurice Eugene Heskett, all rights reserved.