ADSM-L

Re: Return Codes

1996-12-10 13:19:42
Subject: Re: Return Codes
From: Francis Dequenne <syf AT ECMWF DOT INT>
Date: Tue, 10 Dec 1996 18:19:42 +0000
Dwight,

I am afraid that I do not agree with your point of view, at least on UNIX
platforms. Commands should provide meaningful return codes, for the sake of
poor programmers that have to write scripts :-). It is then the user/programmer
responsibility to ignore these codes or not.

For example, if one wants to use adsm to archive/retrieve files, and these
operations need to be done as part of a batch script, one has presently a hard
time to trap error conditions. Certainly on our site, these can not be ignored
(e.g. before deleting the local copy of a file that was supposed to be
archived, we need to make sure that no error were encountered during the
archive processing.).

On Dec 10, 11:02am, Dwight Cook wrote:
<=> Subject: Re: Return Codes
<=>     NO IT DOESN'T... BUT like you mentioned if you look in your log
<=>     (unless you are running quiet) you will see everything listed with a
<=>     status and then at the end there will be an overall condition of
<=>     completion statement...
<=>
<=>     Lots of folks have complained about this but ADSM is following the
                                                     =====================
<=>     guidelines of all other programs basically...
        =============================================

Are you sure about this?

<=>     compare it to logging
<=>     onto your AIX node... you run many commands/tasks... if you run a
<=>     program that crashes would you want your logon session to report that
<=>     it failed when you logoff/exit ?  Better would be, if you were typing
<=>     90 miles an hour, hit your caplock, typed LS <ent> and the system
<=>     would come back with LS not found... one little syntax error... would
<=>     you now want misc reporting to state that your logon session was a
<=>     failure due to that ? ? ? ? ?

Return codes should not be simply classified as success of failure. A simple
method that could be used with dsmc is to provide a 0 rc if everything went
well, 1 if warning messages  (W) have been encountered, 2 if real error
messages (E) have been encountered. Much more elaborate schemes could be
defined, I am sure.

<=>
<=>     later
<=>         Dwight
<=>
<=>
<=>
<=>______________________________ Reply Separator
_________________________________
<=>Subject: Return Codes
<=>Author:  ADSM-L (ADSM-L AT VM.MARIST DOT EDU) at unix,mime
<=>Date:    12/9/96 3:32 PM
<=>
<=>
<=>Hello,
<=>
<=>Does anybody know if the AIX command line interface, dsmc, provides any
<=>kind of return code indication as to the status of a backup or archive
<=>operation? The user guide certainly doesn't contain any info on the
<=>subject. It sure would beat searching thru the redirected output of the
<=>backup/archive job for a text string containing '... ended with 0 failures'
<=> End of excerpt from Dwight Cook



--
Regards
Regards

+-------------------+----------------------------------+---------------------+
| Francis Dequenne  | Systems Section                  |      /~~\  /~~\     |
| ECMWF             | e-mail: fdequenne AT ecmwf DOT int      |     /    \/    
\    |
| Shinfield Park    | Tel:    (+44 1734) 499361        |   ECMWF             |
| Reading           | Fax:    (+44 1734) 869450        |   ECMWF             |
| Berkshire RG2 9AX | Telex:  (+44 1734) 847908        |     \    /\    /    |
| United Kingdom    |                                  |      \__/  \__/     |
+-------------------+----------------------------------+---------------------+
<Prev in Thread] Current Thread [Next in Thread>