Topic "Using sync to download new files only"

Author Message
[View user's profile]

Joined: 2015-07-26
Posts: 1
Hi all

What I'm trying to do is have as a scheduled task regularly retrieve files (including subfolders) from remote /media/folder and place them in local c:\download. I'm using this (which seems to do the job very well): /command "option batch abort" "open sftp://user:pass@site" "synchronize local -criteria=size -preservetime -transfer=automatic -resumesupport=on C:\download /media/folder" "close" "exit"

The problem is that I then have another program monitoring c:\download which moves files and folders received based on certain criteria. The problem, of course, is that when runs the next time, it sees that the files are missing, and downloads them again - when all I want are the new files it hasn't seen before. Any suggestions about how to get around this? I was thinking there might be a way for windows task scheduler or winscp to store its last run time in an environment variable or in a file or something, and then add something like -filemask=>%LASTRUNTIME% to the above command so that it only grabs files in /media/folder newer than the last run date... but I can't work out how to do that.

Any suggestions?
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
As you have already realized, you have to create the synchronization script dynamically with the file mask with time constraint.

What you can do is dynamically generate the script for the next run as the end of the synchronization using the current timestamp.

See also

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