Amanda-Users

Re: problems with label of tape in last slot

2005-11-07 03:45:24
Subject: Re: problems with label of tape in last slot
From: Stefan Herrmann <magic99de AT web DOT de>
To: amanda-users AT amanda DOT org
Date: Mon, 7 Nov 2005 09:30:35 +0100
Am 04.11.2005 um 17:18 schrieb Jon LaBadie:
On Fri, Nov 04, 2005 at 11:33:38AM +0100, Stefan Herrmann wrote:

Am 04.11.2005 um 11:20 schrieb Paul Bijnens:
I'm still waiting for the "sh -vx" output of chg-disk.
The last one you sent, was a normal case, not the case of
going from the last-but-one to the last slot.

So do:

 $ cd /usr/local/amanda/etc/amanda/daily
 $ /usr/local/libexec/chg-disk -slot 7
 $ sh -vx /usr/local/libexec/chg-disk -next

sorry, forgot that .. output is attached, hope it's ok this time.

bye
stefan Herrmann

7 file:/Volumes/amanda1/daily
#! /bin/sh
#
# Amanda, The Advanced Maryland Automatic Network Disk Archiver
# Copyright (c) 1991-1999 University of Maryland at College Park
# All Rights Reserved.
#
# Permission to use, copy, modify, distribute, and sell this software and its
...
CLEANFILE=$CHANGERFILE-clean
+ CLEANFILE=/usr/local/amanda/etc/amanda/daily/changer-clean
...
[ ! -f $CLEANFILE ] && echo 0 > $CLEANFILE
+ '[' '!' -f /usr/local/amanda/etc/amanda/daily/changer-clean ']'
...
CLEANCOUNT=`cat $CLEANFILE`
cat $CLEANFILE
++ cat /usr/local/amanda/etc/amanda/daily/changer-clean
+ CLEANCOUNT=

There is some problem with your "changer-clean" file.
Note the "CLEANCOUNT" gets set to null.

Then around line 155 it causes other problems.
The code is:

  if [ $NEWSLOT = $CLEANSLOT ]; then
      expr $CLEANCOUNT + 1 > $CLEANFILE

+ '[' 8 = 8 ']'
+ expr + 1
expr: syntax error
+ echo 0

The expr has problems because $CLEANCOUNT is null.
And the "cleanfile" is overwritten by the redirection
as an empty file again.

The initialization part of the code checks for the existance
of a "cleanfile", but doesn't check the contents or the ability
of the script to read/write the file.

I'd suggest you check the ownership/permission/existance of
'/usr/local/amanda/etc/amanda/daily/changer-clean'.  If empty
or containing a non-numeric, make it a 1 line file containing
a zero.

After you try using slot 8 again, hopefully successful, check
the cleanfile again.  Maybe something trashes in the script.
More likely you created this file during setup using something
like touch, which left it empty.  All was well until you used
the last slot.

thanks for the help. the changer-clean file was empty, now I put a 0 in it. hope that fixed the problem. the output of the above script now looks ok.

bye
Stefan Herrmann


<Prev in Thread] Current Thread [Next in Thread>