On Friday 26 March 2010, Michael Mueskens wrote:
>Gene Heskett schrieb:
>> On Friday 26 March 2010, Toomas Aas wrote:
>> It has been a while since I visited my wrapper scripts, but ISTR I had
>> to train my scripts that an error return of 1 was perfectly ok.
>
>hello Gene,
>
>how exactly did you do that? Did you change something in the
> amanda-source? Is this error output not from the client, so you have to
> patch something in the amanda-client-code?
>I'm having that problem since upgrading my _servers_ to 2.6.1p2 too, so
> I'd be quiet interested in any way to suppress that non-error? :)
>
>Michael

In bash, you can assign that error and process accordingly.  Here is a 
snippet of that part of my wrapper script, with the language sanitized 
for the list:

       ${AM_SBIN_DIR}/amdump $CONFIGNAME $HOST $DLE >> $LOG
        SCS=$?
        echo ${AM_SBIN_DIR}"/amdump "$CONFIGNAME $HOST $DLE" returned "$SCS 
>>$LOG
        if [[ $SCS -ne "0" ]] ; then
# according to the info page, any error is "probably a 2" return.  Dumb, effing 
dumb.  Real effing dumb even.
# so apparently a file that got changed in the users maildir is an error.  Its 
gonna happen, just ignore it.
                if [[ $SCS -gt "2" ]] ; then
                        echo "amdump THINKS it or tar failed for some reason, 
see the $LOG file." |tee -a $LOG
                fi

The $? transfers the return value to the SCS variable. $SCS is then checked 
to see if its a real error.

-- 
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)

> Tut mir Leid, Jost, aber Du bist ein unertraeglicher Troll.
Was soll das? Du *beleidigst* die Trolle!
        -- de.comp.os.unix.linux.misc

Reply via email to