Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

noahnu

Conditional File Download/Sync

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%"
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