Amanda-Users

Re: problems with label of tape in last slot

2005-11-04 11:23:28
Subject: Re: problems with label of tape in last slot
From: Jon LaBadie <jon AT jgcomp DOT com>
To: Amanda Users List <amanda-users AT amanda DOT org>
Date: Fri, 4 Nov 2005 11:18:08 -0500
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.

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

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