Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
cron_for_pause.s
This sample applies to Robo-FTP v3.5.0. CRON functionality may vary for older or newer versions.
A typical requirement for a script is to perform a series of commands, wait a certain amount of time, then repeat.
A simple way to do this is to use the PAUSE command like this:
PAUSE /for=3600
That command would pause Robo-FTP for 3600 seconds (one hour).
However, scheduling requirements are often more complex. Some typical additional requirements might include:
- Only run during business hours (8am until 5pm)
- Only run Monday through Friday
The CRON command can be used instead of PAUSE to handle these additional requirements.
This sample script uses CRON to pause script execution for 30 minutes, perform a series of uploads and downloads, then repeat.
1 ;; IMPORTANT: This script requires you to first create a
2 ;; file called "crontab.txt" and save it to the C:\Program
3 ;; Files\Robo-FTP directory. The "crontab.txt" file must
4 ;;contain the following line:
5 ;;
6 ;; 30 8-17 * * 1-5
7 ;;
8 ;; The above line will cause the script to run every 30
9 ;; minutes during business hours (8am-5pm, Mon-Fri)
10
11 :top
12 CRON
13
14 FTPLOGON "EDI Server"
15
16 ;; Outbound
17 FTPCD "/send"
18 WORKINGDIR "c:\out"
19 SENDFILE "*.mss" /delete
20
21 ;; Inbound
22 FTPCD "/received"
23 WORKINGDIR "C:\in"
24 RCVFILE "*"
25
26 FTPLOGOFF
27 GOTO top
28

