Scheduling File Transfers With FileLink |
Top Previous Next |
Part of FileLink’s usefulness is derived from its ability to perform file transfers unattended at scheduled times when running a script.
The Scheduling Script Commands
Scheduling operations within a script file are controlled by using either the PAUSE or CRON script commands.
The PAUSE command is the simplest method and is best suited for scheduling a one-time event. This command results in script execution being suspended for fixed period of time (e.g., 60 minutes) or until a fixed time of day (e.g., 11PM). At the designated time, the script “wakes up” and performs a series of tasks. If the tasks are to be repeated, the script would loop back to the PAUSE command and wait for the next designated time to arrive.
The CRON command provides much more complex scheduling. This command allows events like “every Tuesday and Thursday at 11PM”, “once a month at midnight of the 5th day”, “every 15 minutes on March 30”, etc., and any combination thereof to be scheduled. To make scheduling with the CRON command more simple, FileLink includes the CronMaker scheduling utility. With CronMaker, you build the "crontab.txt" input file to the CRON command with a few mouse clicks. When the next CRON event triggers, the script “wakes up” and performs a series of tasks. If the tasks are to be repeated, the script would loop back to the CRON command and wait for the next CRON event to trigger.
Launch FileLink running a script with one or both of these commands and the scripted tasks will occur when you want them to.
Using the CRON Command - A Brief Overview
When scheduling task(s) with CRON, there are usually three discrete components that need to be created:
1. One or more scripts that perform the tasks you want done. 2. The event file used by the CRON command. 3. A simple “master” script which loops to execute the CRON command and to launch the script(s) that do the work.
To schedule tasks with CRON, the following step-by-step approach is suggested.
First, create and test the script(s) needed to perform the file transfer tasks at hand. It is important that you test that each script does what you want it to BEFORE subjecting them to a final scheduled environment.
Next use the CronMaker utility to create or edit the event schedule. This process creates an event file (normally named “crontab.txt” that is saved in FileLink’s program files folder). This file is direct input for the CRON command.
To make it all work, launch FileLink with the master script. The master script executes the CRON command which will in turn launch task specific scripts at the scheduled times and then loop back to await the occurrence of the next event.
The following is a sample master CRON script:
There is a similar file named “CronMaster.s” provided with FileLink in the Sample Scripts folder.
Scheduling Dependability When Running as an NT Service
This scheduling capability is further enhanced by FileLink’s ability to be installed and run as an NT service on Windows NT, 2000, and XP machines. (NT services are not supported in Windows 98 or ME.) When running as a service, FileLink starts when the system boots up and remains active all the time - you don’t need to remember to start it up every day.
Installing FileLink as an NT service is easy using the provided SrvInstaller utility. To perform scheduled operations, install FileLink as a service using a suitable script that incorporates either or both of the PAUSE and CRON script commands.
Summary
The combination of FileLink’s scheduling and NT service capability is a powerful combination to make sure that your file transfers take place dependability when you want them to.
|