Differences

This shows you the differences between the selected revisions of the page.

2008-06-19 2009-02-20
no summary (121.217.216.94) expand to synchronizations (martin)
Line 1: Line 1:
-====== How do I automate file transfers? ====== +====== How do I automate file transfers, synchronization or other operations? ====== 
-WinSCP offers [[scripting]] interface that you can use to automate many operations that it supports, including file transfers.+WinSCP offers [[scripting]] interface that you can use to automate many operations that it supports, including file transfers and synchronization.
===== Commands ===== ===== Commands =====
Line 6: Line 6:
  * Set script to be performed non-interactively. For most automation scripts, you should use commands ''[[script_commands#option|option batch on]]'' and ''[[script_commands#option|option confirm off]]''.   * Set script to be performed non-interactively. For most automation scripts, you should use commands ''[[script_commands#option|option batch on]]'' and ''[[script_commands#option|option confirm off]]''.
  * Open session. You can use ''[[script_commands#open|open]]'' command (alternatively specify session on [[commandline|command line]]).   * Open session. You can use ''[[script_commands#open|open]]'' command (alternatively specify session on [[commandline|command line]]).
-  * Perform operation. For [[task_upload|uploads]] use ''[[script_commands#put|put]]'' command. For [[task_download|downloads]] use ''[[script_commands#get|get]]'' command. For other operations, see [[script_commands|supported commands]].+  * Perform operation. For [[task_upload|uploads]] use ''[[script_commands#put|put]]'' command. For [[task_download|downloads]] use ''[[script_commands#get|get]]'' command. For [[task_synchronize_full|synchronization]] use ''[[script_commands#synchronize|synchronize]]'' command. For other operations, see [[script_commands|supported commands]].
  * Exit scripting using ''[[script_commands#exit|exit]]'' command.   * Exit scripting using ''[[script_commands#exit|exit]]'' command.
Line 73: Line 73:
Once you find out what was the result of the script, you can perform any action you like. E.g. after evaluating exit code of WinSCP, you can send a "success" or "error" email. For that use any command-line email client you like, e.g. [[http://glob.com.au/sendmail/|sendmail]]: Once you find out what was the result of the script, you can perform any action you like. E.g. after evaluating exit code of WinSCP, you can send a "success" or "error" email. For that use any command-line email client you like, e.g. [[http://glob.com.au/sendmail/|sendmail]]:
 +
<code> <code>