Re: ammkvtapes.sh
2005-11-16 05:51:18
Paul Bijnens wrote:
...
if [ -d $VTAPE_DIR ]; then
echo "found existing tape-dir at " $VTAPE_DIR
if [ $FORCE_DEL = "1" ]; then
echo "ATTENTION - force-flag set !!!"
# rm -fR $VTAPE_DIR
In the production environment, I guess the comment sign needs to be
removed.
correct.
...
TAPELIST="$CUR_CONF_DIR/tapelist"
if [ -d $TAPELIST ]; then
Shouldn't that be a test for file instead: if [ -f $TAPELIST ] ?
correct.
...
for n in 1 to $NUM_TAPES
do
mkdir -p $VTAPE_DIR/slot${n}
chmod -v 750 $VTAPE_DIR/slot${n}
rm -f $VTAPE_DIR/data
ln -s $VTAPE_DIR/slot${n} $VTAPE_DIR/data
$AMLABEL $CONF daily${n} slot ${n}
This has the string "daily" hardcoded.
My test-config ...
It should somehow get the
labelstring reg.exp. like "^daily[0-9]*' and convert that into
a fixed part + variable number. That's too difficult for me at this
time of the day.
Alternatively, you could supply a string to this script with
a placeholder for the number, like "ammkvtapes.sh config daily0",
and let the number increment automatically.
Note that the default config for many distro's is "Dailyset1" and
the labelstring has something like "Dailyset1[0-9]*', which in
this case should not increment the '1' which should be fixed.
As, said, too difficult at this time of the day.
I am not so sure if this isn't too difficult for me at ANY time of the
day ;)
Some decent regexp-fiddling ahead, I assume. Maybe we have a volunteer
reading?
...
amtape $CONFIG show
echo "OK"
Be careful here: "amtape show" advances the changer by one slot.
And because all the vtapes are new tapes, amanda accepts any tape.
That would result in slot 2 being the first one to dump to, skipping
slot 1. Not an error, but strange.
I would add a cmd "amtape $CONFIG reset" after this line, so that
slot 1 is loaded again.
I understand and agree.
Thanks a lot for the feedback, Stefan.
|
|
|