Attachmate Worldwide  |   Contact Us  |   NetIQ.com
Home » Support » Solution Library

Technical Notes

Automating Reflection FTP Client File Transfers
Technical Note 1308
Last Reviewed 13-Nov-2008
Applies To
Reflection FTP Client version 12.0 or higher
Summary

This technical note explains how to automate FTP transfers with the Reflection FTP Client. The following instructions explain how to record and edit a Reflection FTP script and describe the command line parameters to run Reflection from Windows Scheduled Tasks.

The Reflection FTP Client is a component of many Attachmate products (including Reflection, EXTRA!, and INFOConnect).

Automating File Transfers with the FTP Client and Reflection

If you are using the FTP Client, you can automate file transfers in just a few steps. First, record an FTP script. Next, create a Reflection Basic script that calls the FTP Client and runs your FTP script. Finally, use Reflection's event scheduler to run the Reflection Basic script at a specified time.

Note the following:

  • Reflection does not check for errors when recording an FTP script.
  • This technical note addresses Reflection's scripting capabilities. To program Reflection to perform a broader variety of tasks, including error analysis, use the Reflection FTP OLE Automation API.

Generating a Reflection FTP Script File

Once you have successfully configured the Reflection FTP Client to automatically connect to an FTP server, you can automate file transfers using the Script Recorder

  1. Connect to your FTP site.
  2. Click Script > Start Recording.
  3. Navigate as needed, and transfer or delete files.
  4. When you are finished, click Script > Stop Recording.

For more information on performing file transfers and recording script files, see the FTP Client online help.

Editing the FTP Script File

Depending on how your FTP Client is configured, certain actions may require user intervention, which could stall the automatic processing of your FTP script. To avoid this problem, edit your script as described below:

  1. In the FTP Client, click Script > Edit Script.
  2. Locate the file you created in the previous section and click Open to open the file in Notepad.
  3. Insert the following commands at the top of your FTP script.
SET TRANSFER-DISPOSITION OVERWRITE
SET RESUME-PARTIAL-TRANSFERS NEVER
SET CONFIRM-DELETE NO
SET SMART-TYPE-DEFAULT BINARY
  1. At the end of your script add a line with the Quit command so that Reflection FTP exits when your script is finished. Quit only causes FTP Client to close when the script is initiated from a command line.
QUIT
  1. Click File > Save.
  2. Exit Notepad.

For more information on FTP script settings, see the FTP Client online help.

Testing the FTP Script

After you have saved the script, connect to your FTP site and click Script > Run Script to test your script.

Initiating the Script from the Command Line

You can run your script from the command line in a BAT file, Windows Shortcut, scheduler program, or shell command.

<path>RFTPC.EXE "<FTPSiteName>" /RFS "<path>\Script.rfs" /L "<path>\Log.log"

Example

The following command would start Reflection FTP Client from its default location, connect to the FTP Site named "MySFTPSite," run the script FTPScript.rfs, and create a log file C:\Temp\FTPLog.log:

"C:\Program Files\Attachmate (in version 14.0)\Reflection\rftpc.exe" "MySFTPSite" /RFS
"C:\Program Files\Attachmate (in version 14.0)\Reflection\User\FTPScript.rfs" /L "C:\Temp\FTPLog.log"

Test your command line in the Windows Start Run dialog box until the Reflection FTP Client opens, runs your script, and closes.

Common Methods of Scheduling Events

Use any of the following methods to schedule an event.

Windows Scheduled Tasks

Windows Task Scheduler can be used to schedule commands and programs to run at a specified time and date. To access Task Scheduler:

In Microsoft Vista: Click Start > Administrative Tools > Task Scheduler.

In Windows XP and Windows 2000: Click Start > Settings > Control Panel > Scheduled Tasks.

Create a new task to run RFTPC.EXE.

Reflection FTP Client stores FTP site information and settings in the Windows Registry. Therefore, when scheduling a task to automate FTP Client scripts, you must configure your task to use the same Windows user as the user who created the FTP sites and settings.

Before you click Finish on your Task, select the check box labeled "Open advanced properties for this task when I click finish." Edit the Run line parameters so that it matches your tested command line.

Windows NT AT Command

AT Command is a Windows NT service that schedules commands and programs to run at a specified time and date. The Schedule service must be running for AT Command to function properly. For more information on using AT Command, see the online help in Windows NT or visit the Microsoft web site at http://microsoft.com.

WINAT

A utility called WINAT, included in the Windows NT Resource Kit, adds a graphical interface to AT Command and automatically starts the Schedule service. For more information on WINAT, visit the Microsoft web site at http://microsoft.com.

Related Technical Notes
1176 Reflection FTP Client Technical Notes
2362 Programming with Reflection FTP Client and COM
9990 Technical Notes for Reflection for HP, UNIX and OpenVMS
9993 Index of Reflection Scripting Technical Notes

Did this technical note answer your question?

Yes    No    Somewhat     Not sure yet

Additional comments about this tech note:

Need further help? For technical support, please contact Support.