Topic "Conditional File Download/Sync"

Author Message
noahnu
[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:

Code:

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


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?

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

See some examples:
https://winscp.net/eng/docs/guide_interpreting_xml_log
_________________
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