Re: Ftp script condition code 0

From: Paul LaMadeleine (plamadeleine@LIGHTBRIDGE.COM)
Date: Wed Feb 12 2003 - 17:06:01 EST


Unless the ftp binary dies in some horrible way (say a core dump or
something), then it will always exit with a 0. Just because the data
transfer failed does not mean ftp did not run correctly. As an example,
say you telnet somewhere, type in exec ls xyz123, and the ls fails, the
status of the telnet would still be 0.

In order to check if the command you want ftp to process happened, you'll
need to do some extra processing, either of parsing of output or something.

         Hope this helps.

         Paul

At 12:17 PM 2/12/2003 -0800, you wrote:
>When I run ftp scripts I check for the condition code;
>but I have found , that when the ftp fails -
>say I don't connect - the condition code from the ftp
>is always condition code zero.
>
>Why does this occur ? Is there a circumvention to this issue ?
>
>
>Here is a sample ( simplified ) script :
>
>ftp -i -v clients.dns.name < my_ftp_parms
>
>
>if [ $? != 0 ]
> then
> echo "myclient zip ftp error" >> /my/ftp5950/oztcmo.log
> mail -s "UNZIP ERRORS"
> <mailto:sgly0@ucop.ais.ucla.edu>sgly0@ucop.ais.ucla.edu <
> /my/ftp5950/oztcmo.log
> exit 0
>fi
>
>
>
>
>
>
>
>
>John Yard
>UCLA Administrative Information Systems
>Distributed Platforms
>Unix/Win2000 Admin/Sybase/Oracle/SqlSrvr/Networking
>310-825-1725
>
>



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:35 EDT