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

pc99

Using sync to download new files only

Hi all

What I'm trying to do is have winscp.com 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):

winscp.com /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 winscp.com 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?