Topic "Keep Connection Alive"

Author Message


I have a scanner that drops files into a folder throughout the day. I need to automatically upload these files to a server. I created this script to do that job, and a .bat file for my users to launch WinSCP.

But, how can I keep the connection alive, or reconnect every time a file is placed in the required folder?


# Automatically answer all prompts negatively not to stall
# the script on errors (off), set to 'contunue' to ignore all errors.
option batch off

# Attempt reconnect in 3 seconds if connection fails
option reconnecttime 3

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Open connection to server
open ftp://[server].com:[port#]

# Synchronize directories so 'keepuptodate' won't cause problems.
synchronize both "C:\Documents and Settings\user\Desktop\FTP_folder"

# With the sync we can use 'uptodate' to keep the folders synced
keepuptodate -delete "C:\Documents and Settings\user\Desktop\FTP_folder"
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
You can configure keepaliaves in GUI only. Though this FAQ may help you.
Martin Prikryl

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License