FTP skipping commands in AIX
- From: "steven_nospam at Yahoo! Canada" <steven_nospam@xxxxxxxx>
- Date: Thu, 16 Oct 2008 07:56:27 -0700 (PDT)
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
.
- Follow-Ups:
- Re: FTP skipping commands in AIX
- From: dl8fbh
- Re: FTP skipping commands in AIX
- From: Hajo Ehlers
- Re: FTP skipping commands in AIX
- Prev by Date: Re: link issue
- Next by Date: Re: filesystem increasing without logical reason
- Previous by thread: link issue
- Next by thread: Re: FTP skipping commands in AIX
- Index(es):
Relevant Pages
|