ADSM-L

Re: Scheduled archive shell script returns no error, but archive script failed !

2002-03-11 10:01:13
Subject: Re: Scheduled archive shell script returns no error, but archive script failed !
From: Thomas Denier <Thomas.Denier AT MAIL.TJU DOT EDU>
Date: Mon, 11 Mar 2002 09:58:39 -0500
[Material deleted]
> But I found there was an error in our "/home/tsm/dsmc_archive.sh" shell >
script, that caused it to fail. The script looks like :
>
> dsmc archive -archmc=migartion_archive -subdir=yes -quiet -archsyml=no \
> /sapmnt/T21/
> dsmc archive -archmc=migration_archive -subdir=yes -quiet -archsyml=no \
> /usr/sap/put/
>
> In the first line of the script, I made a typo, specifiying an inexistant
> management class, therefore the script failed !
>
> How is it possible that TSM returns me "completed", as this script failed?
> Is it a bug ? Is there any way checkin the real status of the schedule,
> without logging on the node to verify dsmsched.err ?

In the absence of an exit statement, the exit status of a shell script is the
exit status of the last command executed. Since the second and last dsmc
command in your script ended with a zero exit status, the script ended with a
zero exit status. TSM quite reasonably reported this as successful completion.
If you want failures reported reliably you will need to add some explicit
error checking to the script.
<Prev in Thread] Current Thread [Next in Thread>