The Secrets to Better Automation Scripts

With a few key things and an FTP client like WinSCP, you can get better automation and improve your file transfer processes.

WinSCP is a popular Windows file transfer client. We often get asked about it’s capabilities and compatibility with our cloud FTP service. One of reasons for it’s popularity is the flexibility and power of its scripting and automation cabapilities.

1. Logs, Logs, Logs

“Logs” by decade_null is licensed under CC BY 2.0

2. Configure (& Use) SSH Keys Rather Than Passwords

“Keys” by jacqui.brown33 is licensed under CC BY-SA 2.0

3. Plan Ahead for Failure

“Fremantle Bridge Collapse, 22 July 1926” by dybarber is licensed under CC BY 2.0
  • Your internet connection is offline when your task is scheduled to run
  • The files you want to download aren’t on the server right now
  • Someone has changed your user’s password (another argument for SSH keys)
  • Your account has exceeded the daily transaction limits, and logins are failing
  • The process crashes when it runs out of memory

A few tools available to help:

  • Notification emails are a good confirmation that expected actions happened and are helpful for figuring out when something stopped working if not noticed right away.
  • Using a batch file to run the executable will allow you to check the returned %ERRORLEVEL% of the program and potentially send off an alert that something went wrong.
  • Remember that first thing? Logs, Logs, Logs! Using log files with your automation provides a quick way to check for problems — often they’ll be spelled out right in those logs.

Make sure to ask yourself several questions as you plan ahead.

  1. Are you able to re-run the script whenever you like, or is the automation locked away on a scheduling system you don’t have access to?
  2. Will the system automatically recover if the script is successful next time, and is that an acceptable delay?
  3. What needs to happen to make sure everything is working properly?

Successful Automations

WinSCP is a powerful and popular tool for automating file transfers. Combining smart usage of log files and SSH keys with a detailed plan can make the difference between an automation that saves you time and a frustrating emergency.

Secure Cloud FTP platform provides full support for manual and automated transfers via web interface, FTP, FTPS and SFTP. Visit