What I am trying to do is mirror a directory (recursively) from a server I can SSH/SFTP to, to a Windows machine. I want to do this as part of a script, so it can be automated.

I only want to copy new or modified files. I don't want to have to download all the files every time the script runs.

In other words, I'm trying to get the equivalent of RoboCopy /MIR that will work using SFTP as a source.

What would you recommend?

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

WinSCP can synchronize directories using /synchronize or with a script.

link|improve this answer
Worked for me, thanks. The command I used: "C:\Program Files (x86)\WinSCP\WinSCP.com" My_Stored_WinSCP_Session /command "synchronize local X:\Local\Target\Directory /the/remote/directory" exit – Andrew Russell May 10 '10 at 1:29
feedback

If you only want to get the files that have changed, I would recommend rsync (under cygwin).

link|improve this answer
My impression is that rsync also needs to be installed on the server I am connecting to? Is this correct? – Andrew Russell May 9 '10 at 1:24
Yes, rsync would need to be installed on the server as well. When given a remote file path, it will connect via SSH and run and rsync daemon on the server. – Brian May 10 '10 at 15:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.