Technical Notes |
|
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).
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.
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
For more information on performing file transfers and recording script files, see the FTP Client online help.
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:
SET TRANSFER-DISPOSITION OVERWRITESET RESUME-PARTIAL-TRANSFERS NEVERSET CONFIRM-DELETE NOSET SMART-TYPE-DEFAULT BINARYQUITFor more information on FTP script settings, see the FTP Client online help.
After you have saved the script, connect to your FTP site and click Script > Run Script to test your script.
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"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.
Use any of the following methods to schedule an event.
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.
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.
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.