Re: Ftp script condition code 0

From: Jolet, John (John.Jolet@MISYSHEALTHCARE.COM)
Date: Wed Feb 12 2003 - 22:39:41 EST


you get a return code of zero because ftp loaded successfully...that's why i
try not to use ftp in my automated stuff....you might have to write your own
perl or something.

-----Original Message-----
From: Yard, John [mailto:syjy0@SMTP.AIS.UCLA.EDU]
Sent: Wednesday, February 12, 2003 3:17 PM
To: aix-l@Princeton.EDU
Subject: Ftp script condition code 0

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" sgly0@ucop.ais.ucla.edu
<mailto: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