FTP skipping commands in AIX



I have an FTP script that operates on a VPN tunnel between AIX and a
remote server. It goes out to the remote host and tries to pick up a
data file that provides updates for incoming material (essentially a
form of EDI). Our server is using the native FTP in AIX 5.1 and the
remote server is running something called "vsFTPd 2.0.5".

The script is relatively simple...We set the local and remote paths,
delete any old file that exist, pick up the new file, then rename the
file we just picked up to the old name. Here is the basic logic:

ftp -i ${GET_HOST} << END >> ${LOG_FILE}
verbose
prompt
lcd ${WORK_DIR}
cd ${GET_DIR}
mdelete ${GET_FILE}.old
mget ${GET_FILE}
rename ${GET_FILE} ${GET_FILE}.hold
quit
END

Our problem that is arising is that one of the four servers we
installed has reported missing transactions. After investigation, we
determined that some of the commands are being "skipped". For example,
every once in a while, it will do the mdelete command, skip the mget,
then execute the rename and the quit.

This is a problem as it means we never picked up the file, but renamed
it, and the next sequence through if it was not caught will simply
delete that old file. To do some verifications, I added debug logic in
there, and to see if it was a timing issue, I added some extra pwd/dir
commands to "buy time". This seems to work even though sometimes
things are still missed. Here is the new logic:

ftp -i ${GET_HOST} << END >> ${LOG_FILE}
verbose
prompt
debug
lcd ${WORK_DIR}
cd ${GET_DIR}
pwd
dir
mdelete ${GET_FILE}.hold
mget ${GET_FILE}
pwd
rename ${GET_FILE} ${GET_FILE}.hold
quit
END


I know that there are many different and probably more secure methods
than FTP out there and people will be asking why we still use this
method. Suffice it to say it is an older legacy system that cannot
currently be changed.

So my questions are:

1) Does anyone know why an FTP script (which I always thought uses
sequential processing similar to a DOS batch script) would skip
certain steps? Could there be an incompatibility issue or perhaps this
is a known issue in AIX 5.1 (other servers are AIX 5.2 or higher and
don't seem to have this issue)

2) Has anyone seen this behavior before and have suggestions on how to
improve the logic? (One idea I have is to get the file here, confirm
it exists, then open a new FTP session to go back and delete the file
at the remote server...)

Thx in advance

Steve
.



Relevant Pages

  • Re: Need help with FTP error
    ... The only reference to the character string "Internal error reported by remote partner" associated with the code 438 is in a manual ... Subject: z/os FTP messages ... I use the FTP server below, but all also applies to the TN3270 server. ... Complicating matters is some RACF panels don't work (the cert delete function, for example) and the FTP server sometimes won't pick up cert changes even when the server is stopped/started. ...
    (bit.listserv.ibm-main)
  • Re: ASP.NET website not displaying
    ... and I do not know if debugging is enabled for the server. ... diagnose the situation via FTP only? ... viewable on remote machines, please create a tag within a ... This <customErrors> tag should then have its "mode" ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Windows 2003 SP2 and FTP
    ... "Connection closed by remote host". ... When I looked at the remote FTP server "Client Session", ... If I take Windows Firewall off on the W2K3 server, ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: Intelligent publish-to-website utility/script?
    ... A program for managing a WWW site via FTP, ... sitecopy is for copying locally stored websites to remote ftp servers. ... to a remote server by performing uploads and remote deletes as required. ...
    (comp.os.linux.misc)
  • Re: Internet Explorer - IE6 - as an FTP client for AIX - strange results
    ... It turns out that if the LANG variable is set to something else than en_US or C, the command ls -l gives a different output, and then the listing received is misunderstood by Internet Explorer. ... Other FTP client such as Fileziall can handle those non-standard outputs, ... All you can do is set the lang to C on the AIX (at least for the FTP server). ...
    (comp.unix.aix)