Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Anonymous wrote:

What about the "Automatically reconnect session, if it breaks while idle"? Is there any script to handle that?

The session generally does not go idle, when using scripting.
See also https://stackoverflow.com/q/29535466/850848
Guest

What about the "Automatically reconnect session, if it breaks while idle"? Is there any script to handle that?
martin

Re: Endurance - Keep reconnecting for Unlimited

The option reconnecttime has the same effect as Automatically reconnect session, if it breaks during transfer.
So it should be working.
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
Vissie

Endurance - Keep reconnecting for Unlimited

Hi. Firstly I HAVE to say that you have one excellent application here. I found it a week ago out of a necessity that I have for coping over large files over a very slow and unreliable link. Who would have known that good old FTP is still the easiest way of doing this?
I have a set of scripts to find the latest DB files in a few directories, then 7Zip then into 50mb chunks. Then FTP them over.
When using the GUI, the application does EXACTLY what it should do. If I get connection issues, the application will try and reconnect indefinitely. When the link is back up, the transfer continues till all files are over. Brilliant!
As you can imagine, I then tried to do the same via scripting. All works, date stamps, changes files etc.
Just one aspect that I could not figure out was how to get from this script to auto reconnect. If there is an error, the application exits. I have used the exit error code (0 or 1) to compensate for this. But it feels like a waste as the GUI has this build in.
So my question is, can I not set these values via script? Things like under "Endurance" - "Keep reconnecting for", "Automatically reconnect session, if it breaks during transfer", etc.

I have tried
option batch on/off
option confirm off/continue
option reconnecttime 15
option resumesupport on (unknown option error)

So pls, what do I need to do, to get the same behaviour in script as what I get from the "Endurance" page under options?

WinSCP 512 Beta

Script I call:
@echo off
SET LOG=logfile.log
 
IF EXIST %LOG% (del %LOG% )
 
:Run_Job
FTP\winscp521\winscp.com /script=MW_FTP.txt /log=%LOG%
 
if errorlevel 1 goto error
echo Success
MailSend\mailsend.exe -d domain.com -smtp mailrelayapp.eu.domain.com -t me@domain.com -f me@domain.com +cc +bc -sub "MW FTP - Success" -M "All went wel." -attach %LOG%
goto end
 
:error
echo Error!
:: MailSend\mailsend.exe -d domain.com -smtp mailrelayapp.eu.domain.com -t me@domain.com -f me@domain.com +cc +bc -sub "MW FTP - Failed!" -M "You had issues. Please check the attached log." -attach %LOG%
goto Run_Job
 
:end


MW_FTP.txt:
option batch on
option confirm off
option reconnecttime 15
 
open ftp://user@otherDomain.com:Password@ftp.otherDomain.com
# Change remote directory
cd /Backups/Vissie/Zam
 
synchronize remote C:\Data\Vissie\Vissie_Backup /Backups/Vissie/Zam -delete -transfer=automatic -criteria=size -resumesupport=on
close
# Exit WinSCP
exit