Differences

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

guide_schedule 2012-03-24 guide_schedule 2024-05-31 (current)
Line 1: Line 1:
-~~NOTOC~~ 
====== Schedule file transfers (or synchronization) to FTP/SFTP server ====== ====== Schedule file transfers (or synchronization) to FTP/SFTP server ======
//This guide contains simplified description of scheduling operations on FTP/SFTP server with WinSCP.// //This guide contains simplified description of scheduling operations on FTP/SFTP server with WinSCP.//
To schedule an operation on FTP/SFTP server you can combine [[scripting|scripting/automation]] functionality of WinSCP with Windows scheduling capability. To schedule an operation on FTP/SFTP server you can combine [[scripting|scripting/automation]] functionality of WinSCP with Windows scheduling capability.
 +
 +===== Before Starting =====
Before starting you should: Before starting you should:
Line 10: Line 11:
  * [[guide_automation|Automate your operations using WinSCP scripting functionality]].   * [[guide_automation|Automate your operations using WinSCP scripting functionality]].
-===== Scheduling on Windows 7 =====+===== [[win10]] Scheduling on Windows 11, Windows 10, Windows 8 and Windows 7 =====
To add new scheduled task: To add new scheduled task:
-  * Go to //Windows Start Menu > Control Panel > System and Security > Administrative Tools > Schedule Tasks//. +  * Open //Task Scheduler//: 
-  * In the Task Scheduler menu go to //Action > Create Basic Task//.+    * Windows 11: Go to //Windows Start Menu > All apps > Windows Tools > Task Scheduler//. Or just type //"Task Scheduler"// into the search box. &win11 
 +    * Windows 10: Go to //Windows Start Menu > Windows Administrative Tools > Task Scheduler//. Or just type //"Task Scheduler"// into the search box. &win10 
 +    * Windows 8.1: Right click Windows //Start// button and select //Control Panel//. In //Control Panel//, go to //System and Security > Administrative Tools > Schedule Tasks//. &win8 &wincp 
 +    * Windows 7: Go to //Windows Start Menu > Control Panel//. In //Control Panel//, go to //System and Security > Administrative Tools > Schedule Tasks//. &win7 &wincp 
 +  * In the //Task Scheduler// menu go to //Action > Create Basic Task//.
  * Give your task a name and click //Next//.   * Give your task a name and click //Next//.
  * Choose when the task should be run and click //Next//.   * Choose when the task should be run and click //Next//.
-  * For task action, select //Start a program// and client //Next//. +  * For task action, select //Start a program// and click //Next//. 
-  * Browse for ''WinSCP.com'' [[executable]]. +  * Browse for ''WinSCP.exe'' [[executable]]. 
-  * In //Add arguments// add appropriate WinSCP [[commandline|command-line]] parameters to execute the [[scripting#commands|scripting commands]] you need (typically you will use ''/script or ''/command'' parameters). \\ The resulting arguments may look like: '' %% /command "option batch abort" "option confirm off" "open user:password@example.com" "put d:\examplefile.txt /home/user/" "exit" %% '' +  * In //Add arguments// add appropriate WinSCP [[commandline#scripting|command-line]] parameters to execute the [[scripting#commands|scripting commands]] you need (typically you will use ''/script'' or ''/command'' parameters). 
-··* You may want to use ''/log'' parameter to turn on [[logging|session logging to file]].+· * You should also add ''[[commandline#logging|/log]]'' parameter to turn on [[logging|session logging to file]]. 
 +  * The resulting arguments may look like (as a single line): &lt;code batch,wrap&gt;/log=c:\path\winscp.log /command "open sftp://user:password@example.com/" "put d:\examplefile.txt /home/user/" "exit";</code>; Note that the command-line parameter ''[[commandline#scripting|/console]]'' was not specified, which makes ''WinSCP.exe'' not show the console window, so as not to disturb you while you are using your workstation. \\ You can have WinSCP [[guide_automation#generating|generate the command-line template]] for you. 
 +  * If your script uses local paths relative to the script path or WinSCP executable path, specify the respective path in //Start in// field.
  * When done, click //Next//, review your options and confirm with //Finish//.   * When done, click //Next//, review your options and confirm with //Finish//.
- 
-If something does not work, and you want to debug, you can do it like this: Go to //Windows Start Menu > Run// . And then type ''cmd'' and hit //Enter//. Then you type something like ''C:\some program folder\WinSCP\WinSCP.exe /console'' , and hit //Enter//. Now you can test one single command at a time. First you usually want to test // open user:password@example.com //. And then perhaps // put d:\examplefile.txt /home/user/ //. And see what happens, and not. 
- 
- 
===== Scheduling on Windows XP and Earlier ===== ===== Scheduling on Windows XP and Earlier =====
-To add new scheduled task: +To add new scheduled task: &winxp &winold 
-  * Go to //Windows Start Menu > Settings > Control Panel > Scheduled Tasks > Add Scheduled Task//. +  * Go to //Windows Start Menu > Settings > Control Panel > Scheduled Tasks > Add Scheduled Task//. &wincp 
-  * Browse for ''WinSCP.com'' [[executable]], and setup other task properties (like period of execution). +  * Browse for ''WinSCP.exe'' [[executable]], and setup other task properties (like period of execution). 
-  * In advanced properties add appropriate WinSCP [[commandline|command-line]] parameters to execute the [[scripting#commands|scripting commands]] you need (typically you will use ''/script'' or ''/command'' parameters). \\ The resulting command may look like: '' %% "C:\Program Files\WinSCP\WinSCP.com" /command &quot;option batch abort&quot; &quot;option confirm off" &quot;open user:password@example.com" "put d:\examplefile.txt /home/user/" "exit" %% '' +  * In advanced properties add appropriate WinSCP [[commandline#scripting|command-line]] parameters to execute the [[scripting#commands|scripting commands]] you need (typically you will use ''/script'' or ''/command'' parameters). 
-  * You may want to use ''/log'' parameter to turn on [[logging|session logging to file]].+· * You should also add ''[[commandline#logging|/log]]'' parameter to turn on [[logging|session logging to file]]. 
 +  * The resulting command may look like (as a single line): &lt;code batch,wrap>"C:\Program Files (x86)\WinSCP\WinSCP.exe" /log=c:\path\winscp.log /command "open sftp://user:password@example.com/" "put d:\examplefile.txt /home/user/" "exit";</code>; &winpath &amp;win64 Note that the command-line parameter ''[[commandline#scripting|/console]]'' was not specified, what makes ''WinSCP.exe'' not show the console window, not to disturb you while you are using your workstation. \\ You can have WinSCP [[guide_automation#generating|generate the command-line template]] for you. 
 +  * If your script uses local paths relative to the script path or WinSCP executable path, specify the respective path in //Start in// field.
-If something does not work, and you want to debug, you can do it like this: Go to //Windows Start Menu > Run// . And then type ''cmd'' and hit //Enter//. Then you type ''C:\Program Files\WinSCP\WinSCP.exe /console'' , and hit //Enter//. Now you can test one single command at the time. First you usually want to test // open user:password@example.com //. And then perhaps // put d:\examplefile.txt /home/user/ //. And see what happens, and not.+===== Scheduling using Microsoft Azure WebJobs or Azure Functions =====
 +You can use WinSCP from an [[guide_microsoft_azure_webjob_sftp|Azure WebJob]] or an [[guide_microsoft_azure_function_sftp|Azure Function]] as a cloud-hosted scheduled task.
===== Further Reading ===== ===== Further Reading =====
  * [[faq_scheduler|FAQ on scheduler]] to prevent common mistakes with scheduling;   * [[faq_scheduler|FAQ on scheduler]] to prevent common mistakes with scheduling;
-  * [[troubleshooting|Troubleshooting]];+  * [[guide_debugging_scheduler|Debugging transfer task running in Windows Scheduler]] or generic [[troubleshooting|troubleshooting]] guide;
  * Guide to [[guide_automation|automation]];   * Guide to [[guide_automation|automation]];
  * [[commandline|Command-line parameters]];   * [[commandline|Command-line parameters]];
  * [[scripting|Scripting]] documentation.   * [[scripting|Scripting]] documentation.

Last modified: by 90.230.133.18