Posted: 2015-08-30 14:01
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.
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.
You can post new topics in this forum
And it's free!