decorative banner

Previous | Next               

Table Of Contents

FTPshell scripts enable the automation of file transfer and file processing activities. The scripting language is simple yet expressive and provides for error checking, conditional execution, looping, list handling, wildcard matching, and variable manipulation. Secure file transfers using both FTPS (SSL/TLS) and SFTP (SSH2) are supported in addition to regular FTP. Execution status can be communicated through exit codes, log files, error files, or even by sending a status email from within the script. Scripts may be executed from the command line, scheduled as one-time/recurring tasks, or called from other scripts.

This document contains the scripting language guide, a cookbook of frequently scripted operations, and sample FTPshell scripts. You may also contact our support team at for questions and help on writing FTPshell scripts.

  1 Basic syntax
      1.1 Commenting your script
      1.2 Script commands
      1.3 Predefined Status flags and constants
      1.4 Strings, numbers, variables and lists
      1.5 Conditional execution
      1.6 Loops
      1.7 List manipulation loops
      1.8 Error checking
      1.9 Adding execution delays
      1.10 Forced exit from loops
      1.11 Script termination

  2 Working with string and numeric variables
      2.1 Setting and updating variables
      2.2 Printing variables
      2.3 Incrementing and decrementing numeric variables
      2.4 Converting strings to uppercase or lowercase
      2.5 Modifying string contents
      2.6 Comparing strings

  3 File transfer commands
      3.1 Connecting to remote hosts
      3.2 Local and remote paths
      3.3 Obtaining folder listings
      3.4 Transferring files and folders
      3.5 Dealing with duplicate files
      3.6 Passive mode transfers
      3.7 ASCII and binary transfer types
      3.8 Non RFC959 compliant FTP servers

  4 File system commands
      4.1 Renaming files and folders
      4.2 Deleting files and folders
      4.3 Creating folders
      4.4 Executing custom remote FTP commands
      4.5 Executing local programs
      4.6 Compressing and uncompressing local files and folders
      4.7 Copying and moving local files and folders

  5 Reading and writing local files
      5.1 Opening and closing local files
      5.2 Reading lines
      5.3 Writing lines

  6 Email notification
      6.1 Creating email messages
      6.2 Sending email

  7 Error reporting
      7.1 Setting program exit codes
      7.2 Writing out error files
      7.3 Email notifications

  8 Working with timestamps
      8.1 Generating timestamps
      8.2 Using timestamps

  9 Accessing system information
      9.1 Reading environmental variables
      9.2 Getting the local computer name

  10 Command line script parameters
      10.1 Running a script from the command line
      10.2 Specifying log files
      10.3 Passing Environmental variables

  11 Alphabetic listing of commands and keywords

Previous | Next