I am planning to synchronize around 200 very small files per hour (less than 1KB each file), the source files are on a remote SFTP server and the destination files are on a Windows Server. My fear is the too many connections that I plan to do to the SFTP server (every 10 seconds) to have a near-real time experience.

According to other questions I plan to use WinSCP Synchronize feature and Windows Task Scheduler (to execute a WinSCP script) but as I said I will have to execute it every 10 seconds to have a timely result and the server resources is a constraint.

Any other ideas on how much load will this excessive SFTP connections will mean to the server? Or any suggestion on a better way to keep those folders in "sync". Thanks in advance for any valuable idea.


Wouldn't it be better, if you keep your connection open (to save resources needed for CPU-intensive SSH authentication) and run the synchronize command in a loop? Reconnecting, when connection is lost only.

This would be easily achieved using PowerShell script with use of WinSCP .NET assembly.

Regular WinSCP script won't allow loops and pauses.

If all files are in a single folder (=one directory listing per synchronization run) and about one small file changes at a time only (=one file transfer), the load would be small.

  • Thanks Martin for your idea, but maybe it will make the project too complex, I mean it will be like creating a whole app (for example to handle a server connection restart for instance) while I guess there should be a more neat way to solve it (hopefully). I will give it a try however and let you know. – Andres Calle Dec 12 '13 at 19:49
  • Easy way: Take the PowerShell example for Session.SynchronizeDirectories. Put while loop around the $session.SynchronizeDirectories line (+some sleep). And that's it. For the reconnect, just use the Scheduler. Configure it to run the task every minute or so, and not to run if the previous instance is still running (that's default). So when connection is lost, the PowerShell code terminates and the Scheduler restarts the task. – Martin Prikryl Dec 12 '13 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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