Topic "errorlevels ... again"

Author Message
Prime

Guest


Ok, I thought I had the problem sorted out but there is still an issue.

As per the activity log snippet below, if the remote server times outs, the "abort" is automatically sent ...

The log would indicate that the errorlevel returned is 0 which means it was a success. Clearly this is not the case ... any thoughts?

<-----snippet starts----->
Uploading files started ... <== this comment added by my batch file
batch on
confirm off
Initialisation...
Searching for host...
Connecting to host...
Authenticating...
Host has not answered for 15 seconds.
Wait for another 15 seconds? Pressing 'Abort' button will close session.
(A)bort, (R)etry: Abort
Authentication failed.
Terminated by user.
transfer binary
y:\!Uploads_To_Storm
No session.
No session.
No session.
File(s) successfully uploaded ... <== this comment added by my batch file
<-----snippet ends----->
Advertisements
Guest




I am having this same problem too and find that the timeouts are quite frequent. It should a.) return an error code and b.) there should be some sort of auto-reconnect/auto-retry option.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please post your script file. For me error code 1 is returned, when there is a timeout. Also are you sure you are using the latest version of WinSCP?
_________________
Martin Prikryl
Guest




prikryl wrote:
Please post your script file. For me error code 1 is returned, when there is a timeout. Also are you sure you are using the latest version of WinSCP?


I am using 3.7.6 which the web site reports as the latest.

The relevant section of the script is

:RetryLoop
winscp3.exe /console /script=transfer.txt || goto RetryLoop

Transfer.txt is
option batch on
option confirm off
option transfer binary
open (server location)
synchronize remote
close
exit
Prime

Guest


prikryl wrote:
Please post your script file. For me error code 1 is returned, when there is a timeout. Also are you sure you are using the latest version of WinSCP?


Ok, here it is ...
<-----download script start----->
# Automatically answer all prompts negatively so as not to stall the script on errors
option batch on


# Disable overwrite confirmations that conflict with previous
option confirm off


# Open session to Storm
open username:password@remote.server.com
option transfer binary

#
# Retrieve remote files and put them in our local directory
#


# Get files from Ron & Andy's remote directory and put in Ron's local directory
lcd "y:\!Downloads_From_Storm\Ron"
cd "/Storm HQ to Redcliffe/Ron"
get *.* .\


# Get files from Bob's remote directory and put in Bob's local directory
lcd "y:\!Downloads_From_Storm\Bob"
cd "/Storm HQ to Redcliffe/Bob"
get *.* .\


# Get files from Terry's remote directory and put in Terry's local directory
lcd "y:\!Downloads_From_Storm\Terry"
cd "/Storm HQ to Redcliffe/Terry"
get *.* .\


# Close Transfer Session
close


# Exit the application (WinScp)
exit

<------download script end------>

There isn't anything special here as far as I can tell ... I've just checked, the version I'm running is 3.75 ... I haven't updated to 3.76 yet because the release notes didn't mention any major bug fixes in the area of scripting.

Just to clarify, when I run the script, I should get an errorlevel 1 for ANY failure during the process?

Cheers.

Prime.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Quote:
The relevant section of the script is

:RetryLoop
winscp3.exe /console /script=transfer.txt || goto RetryLoop

Transfer.txt is
option batch on
option confirm off
option transfer binary
open (server location)
synchronize remote
close
exit

Unfortunately for this exact script it works for me. Attempts to connect repeat indefinitely. I'll do more tests.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Prime wrote:
Just to clarify, when I run the script, I should get an errorlevel 1 for ANY failure during the process?

Yes.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License