Topic "Endurance - Keep reconnecting for Unlimited"

Author Message
Vissie
[View user's profile]

Joined: 2013-06-20
Posts: 1
Location: Johannesburg, South Africa
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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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.

_________________
Martin Prikryl
Guest




Quote:
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).


What about the "Automatically reconnect session, if it breaks while idle"? Is there any script to handle that?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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 http://stackoverflow.com/q/29535466/850848
_________________
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