Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No ftp Connection

Status
Not open for further replies.

tbohon

Programmer
Apr 20, 2000
293
0
0
US
I run a series of ftp scripts on an AIX box, connecting to both Unix and Windows servers for the drops. I'm occasionally having a problem with being unable to connect to the other server - 'ftp connection refused' type messages (although there are variations) - which, because the users aren't checking files daily as agreed, may cause problems later. Today I'm rebuilding a working master file from 11/2/2007 since they just realized there was no file there!

Is there a way to determine if the ftp connection was rejected by the target server? I've tried a couple of things and they don't work consistently.

My most recent attempt was to 'put' a flag file onto the remote server, then do a 'get' of that same file to a different directory on my server. Once out of the ftp portion of the script, my .ksh script checks for the file's existence and emails if it isn't there under the assumption that I didn't connect. It's OK but, as I said, it's not been totally reliable so I'm looking for something else to try.

Thanks in advance.

Tom

"My mind is like a steel whatchamacallit ...
 
If you just log the output of the FTP session to a file, once that part of the script has completed you can grep through the output file for the '200 transfer ok' message (or whatever syntax it has in your case), and if it's found you can be confident that both the connection and transfer succeeded.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top