Topic "A problem with a script :\"

Author Message
YairGOW
[View user's profile]

Joined: 2013-04-02
Posts: 6
Hey.

I have a script that will automatically download all new files from a certain directory on my server. I run this script every 5 minutes, so sometimes it happens that while transferring one file(let's call this file 'file A'), more files will appear in this directory, and it seems that if the filenames of the new files are alphabettically prior to that of the file that is already transferring, the script will simultaneously download two files on two different sessions if the download wasn't completed in the 5 minutes window between running the scrip again(file A and a new file that has appeared in the folder - file B - will be downloaded in two different sessions). The problem is that when that happens, if file A has been completely transferred, the script will transfer it again from the second session after the transfer of file B is done. That is to say, it won't recognize that it's already fully transferred file A and will start the download of file A from scratch.

My question is, will there might be a way to avoid this kind of situation? Is there maybe a way to limit WinSCP to connect to only one session at a time from a certain server, so the script won't connect twice to the server, thus preventing the simultaneous downloads.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
If you are using Windows Scheduler, you can set it not to run second instance, if previous is still running.
_________________
Martin Prikryl
YairGOW
[View user's profile]

Joined: 2013-04-02
Posts: 6
Edit: Never mind. This can be done with the Windows Watcher feature in System Scheduler.
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