Topic "Conditional File Download/Sync"

Author Message
[View user's profile]

Joined: 2011-05-17
Posts: 1
Hello, I am new to WinSCP scripting.

Basically I have a script that syncs a local folder with one on a server:

option batch off
option confirm off
open ftp://username:password@server:21
option include "*.jpg; *.txt"
synchronize local -criteria=time "%1%" "%2%"

My issue is that I only want WinSCP to download the JPG IF there is an associating txt file with the same name. For example if there is a JPG called hello.jpg then it should only download if the file hello.txt exists. How do I do this? Would I need to rely on custom code for the sync instead of the synchronize command?

Noah NU
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26858
Location: Prague, Czechia
Yes, you would have to.

See some examples:
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