Topic "how to solve runtime problems"

Author Message



I'm using WinSCP 3.8.2 (330) for synchronizing a remote folder (OUT) with a local folder by sftp using a script-file. Synchronization starts with a batch-file:
>cd C:\Programme\WinSCP3
> /script=eccescript.txt

The script-file eccescript.txt contains:
>option batch on
>option confirm off
>option transfer binary
>open s
>synchronize local X:\SFTP /OUT
>mv OUT/*.* OUT.done/*.*

After download the synchronized files (in a second step) are moved from OUT into OUT.done. All of this works perfectly in a static mode.
But what if during the download another file is uploaded by a second user. This file will not be downloaded, because at the beginning of the synchronize-command this file was not yet present. But in the second step it will be moved into the folder OUT.done together with the other files even if it wasn't yet downloaded.
How can I circumvent this problem?


Probably my bad english is not easy to understand! (I'd like to apologize!) I will try to explain it one more time and I hope in a more evident way:

The script works correctly. But what will happen if during the execution of the script a second user uploads another file/directory. I think it will not be downloaded, but it will be moved.
I would like to move only the files that I already downloaded.How can I realize this?

Thanks for your patience!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You can move the files first and synchronize against the OUT.done.
Martin Prikryl

You can post new topics in this forum


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