Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am planning to sync 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 excesive 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.

share|improve this question

Wouldn't it be better if you keep your connection open (to save resources needed for CPU-intensive SSH authentication) and run 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.

share|improve this answer
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .