Cool Tool: WinSCP

SHARE WITH YOUR NETWORK!

Table of Contents

Cool Tool: WinSCP

I just wanted to share with you a very useful tool that’s been around for a while now, and it helped me solve a problem on a customer’s machine.  To properly investigate, I had to extract several logs from the customer’s server on a scheduled basis and have them FTP’d here so that I could keep tabs on the server’s behavior.

If I were using Linux, I could have used a plethora of command-line tools: wput/wget, rsync and Unison, just to name a few. But I wanted something equivalent for Windows.  I found an open-source implementation of wput/wget, but it was rather glitchy and not really reliable.  Unison exists on Windows, but I find it slow and awkward to use. Lo and behold, I found WinSCP1. I like that it has a clean command-line interface that just does the job reliably.  To me, it’s the ‘robocopy’ of file transfers over FTP/SFTP2.

How to use it

In my case, I just wanted to keep my customer’s Logs folder synchronized with my FTP site on a daily basis.  So all I needed to do was write a small batch file that called WinSCP with a simple script that told WinSCP where to get the files and where to place them, keeping the files in sync. For example,

The dosync.bat file:

@echo off
‘c:program fileswinscpwinscp.com’ /script=sync.txt

Basically, the batch file calls winscp.com, telling it to use the sync.txt script.

The ‘sync.txt’ file:

open ftp://username:password@ftp.mydomain.com
synchronize remote d:log /uploads
exit

It’s short, sweet and simple:

– The script opens an FTP connection from the source server where WinSCP is installed to my FTP site
– It then uploads all changed files from the source folder (d:log) to the /uploads folder on the FTP site

I could have done it with a simple ftp script, but WinSCP does both error correction and file completion, which are big pluses.

I now use it all the time.

There is one caveat, though: when you run the installer, it asks if you want to install a third-party application (probably sponsors of the WinSCP project), so you shouldn’t just click ‘Next,’ ‘Next,’ ‘Next’: pay attention to the install process if you aren’t interested in installing those third-party tools.

References:

1. http://winscp.net
2. http://winscp.net/eng/docs/scripting

Explore our Advanced Email Security Solutions

Protect your clients and simplify your operations with reliable, scalable email security solutions. Get in touch today to learn how we can support your success.

SHARE WITH YOUR NETWORK!

Ready to See the Difference?
Discover our advanced security products today.

Scroll to Top