Whats an appropriate way of handling a connection failure in ws_ftp script? I have a job that runs nightly and Im not sure what to do below. My manager just gave me this task and Im not familiar with the keywords.
This is the code in the .scp file that is passed into the ftpscrpt application via a .bat file. The connection failure takes places at line 3, of course :) How should I handle this issue? Increase the timeout? A loop?
What does the log show when the CONNECT fails? Does it fail all the time, or only occasionally?
If it's the case that the server can be down sometimes when the script runs, you could add a PING in the BAT script before the WSFTP execution, and let it loop until the server responds to a PING.
~bp
jdn717
ASKER
Heres the log. It usually connects just fine. Would you mind explaining that PING solution you mentioned. That sounds interesting.
E:\BatchProcesses\ReceivedFiles\RiskImport>ECHO OFF Processing Line 1 [LOG E:\BatchProcesses\ReceivedFiles\RiskImport\RiskImportXML.log] Processing Line 2 [TRACE Screen] Processing Line 3 [CONNECT TBI!RiskImport] Finding Host ftp.tnwinc.com ... [2012.07.06 03:00:15.662] Connecting to 67.202.192.115:21 [2012.07.06 03:00:16.834] Connect failure Failure in command [CONNECT TBI!RiskImport] Processing Line 4 [ONERROR GOTO DISCONNECT] Set [ONERROR] action to [GOTO DISCONNECT] Processing Line 5 [MGET *.pgp E:\BatchProcesses\ReceivedFiles\RiskImport\Files\] Not Connected Failure in command [MGET *.pgp E:\BatchProcesses\ReceivedFiles\RiskImport\Files\] Processing command [ONERROR GOTO DISCONNECT] at line 4 Processing Line 4 [GOTO DISCONNECT] Jump to command [LABEL DISCONNECT] at line 8 Set [ONERROR] action to [CONTINUE ] Processing Line 8 [LABEL DISCONNECT] Processing Line 9 [CLOSE]
Also, you will want to change the 6000 to 60000 in the second PING which is just used as a delay technique. I had lowered it to 6 seconded during some testing here.
~bp
jdn717
ASKER
Yeah, I think this is going to work. I tested it and I am getting satisfactory results. My fortay isnt script so I appreciate the help.
Bill Prew
Welcome, hope that works out for you. Thanks for the feedback.
If it's the case that the server can be down sometimes when the script runs, you could add a PING in the BAT script before the WSFTP execution, and let it loop until the server responds to a PING.
~bp