Automate FTP transfers with Advanced Task Scheduler
Advanced Task Scheduler allows uploading, downloading and deleting files and folders from an FTP, FTPS (Secure FTP) or SFTP (SSH File Transfer Protocol) server. These operations can be scheduled to run at a specified time, time intervals, or by such events as file modification or creation. Advanced Task Scheduler can run FTP transfers when a specified user is logged on to the system or run them in background even when no user is logged on.
All editions of Advanced Task Scheduler support FTP operations. The examples below are for Advanced Task Scheduler Professional.
Upload a file to an FTP server
To upload a file to an FTP server with Advanced Task Scheduler, create a task with FTP file upload shortcut type. Enter path to the file that you want to upload to the Local file field, FTP server address and file path is specified in the Remote file field. Server address must start with ftp://
, ftps://
or sftp://
prefix.
In the If destination file already exists box you can choose how to process already existing files: leave them or overwrite.
There are FTP options in the bottom of the dialog where you can enter username/password and set tunneling proxy settings.
Click the picture to enlarge.
Download a file from an FTP server
To download a file from an FTP server with Advanced Task Scheduler, create a task with FTP file download shortcut type. Enter FTP server address and file path to the Remote file field. Server address must start with ftp://
, ftps://
or sftp://
prefix. Enter path to the file where you want to download the file to the Local file filed.
In the If destination file already exists box you can choose how to process already existing files: leave them or overwrite.
There are FTP options in the bottom of the dialog where you can enter username/password and set tunneling proxy settings.
Click the picture to enlarge.
Upload and download a folder or directory tree
In addition to single file transfer, Advanced Task Scheduler allows FTP operations with multiple files. The Include files and Exclude files fields are used to configure multiple file transfer.
- When both Include files and Exclude files check boxes are unchecked, all files and all subfolders are uploaded or downloaded.
- The Include files field contains a list of files or filemasks to include. Several files and filemasks separated by semicolon can be specified.
For example, "file.txt;*.doc
" will include the file.txt
file and all .doc
files.
- The Exclude files field contains a list of files or filemasks to exclude. Several files and filemasks separated by semicolon can be specified.
For example, "file.txt;*.doc
" will exclude the file.txt
file and all .doc
files.
- To include or exclude files in subfolders, directory separators ("\") can be used in filemasks.
For example, "file.txt
" - include or exclude file.txt
file only,
"dir\file.txt
" - include or exclude file.txt
file from "dir
" subfolder only,
"*.txt
" - include or exclude all .txt
files from all subfolders,
"dir\*.txt
" - include .txt
files from "dir
" and all its subdirectories.
- To download files without recursing down directories in the file system, specify "
*\*.*
" in the Exclude files field.
Delete files from an FTP server
To delete files from an FTP server with Advanced Task Scheduler, create a task with FTP folder delete or FTP file delete shortcut type.
The task options are very similar to the upload and download schedule types.
Error handling if FTP fails
FTP operations return number of files affected in the LastExitCode
value. You can check that value in the IF statement. Please note that if you use Leave existing file option, the left files will not count. The task in the example below displays success or fail message depending on the result on the FTP upload operation.
Click the picture to enlarge.
Categories: Shortcut type, Task scheduler
Leave a Reply
You must be logged in to post a comment.