Automated Tasks

You use the Automated Tasks pages of the Administrator to schedule the execution of local and remote Web pages and to generate static HTML pages. The scheduling facility is useful for applications that do not require user interactions or customized output. ColdFusion developers use this facility to schedule daily sales reports, corporate directories, statistical reports, and so on.

Information that is more often read than written is a good candidate for scheduled tasks. Instead of executing a query to a database every time the page is requested, ColdFusion Server renders the static page with information generated by the scheduled event. Response time is faster because no database transaction takes place.

You can run scheduled tasks once; on a specified date; or at a specified time, daily, weekly, or monthly. You can run a scheduled task daily, at a specified interval, or between specified dates.

You create scheduled tasks and set automation options on these pages:

Automation Settings

The Automation Settings page of the Administrator provides these options:
Option
Description
Scheduler Refresh Interval x Minutes*
The time that ColdFusion Server waits before checking for new or updated scheduled tasks
Enable Logging
Logs scheduled task actions to the schedule.log or file
* This option takes effect after you restart ColdFusion Server.

Schedule Task

The Schedule Task page lets you create, modify, and delete scheduled tasks.

To create a scheduled task:

  1. Click Schedule New Task. The Add/Edit Scheduled Task page displays.
  2. In the Task Name text box, enter a name for the scheduled task.
  3. In the Start Date text box, enter the current date or a future date. (Optional) In the End Date text box, enter a date for the scheduled task to stop running.
  4. In the Schedule to Run section, select one of the options described in the following table:
    Option
    Description
    One Time
    Runs the task once, at a time (HH:MM:SS) in 24 hour format specified in the Start Time text box on the date (MM/DD/YY) specified in the Start Date text box. For the task to execute successfully, the date and time must be set at least 15 minutes in the future.
    Recurring
    Runs the scheduled task according to the frequency specified in the drop-down list. You can run the task daily, weekly, or monthly. Specify a time (HH:MM:SS), in 24 hour format, for the scheduled task.
    Daily
    Runs the scheduled task daily. To run the scheduled task indefinitely:
    • In the Daily Every text box, designate the frequency that the task runs
    • Leave the From and To text boxes empty
    To start a scheduled task on a specific date and run it indefinitely:
    • In the Daily Every text box, designate the frequency, in minutes, that the task runs
    • In the From text box, enter the start date (MM/DD/YY) and leave the To text box empty
    To run a scheduled task between two dates:
    • In the Daily Every text box, designate the frequency, in minutes, that the task runs
    • In the From text box, enter the start date (MM/DD/YY) and the stop date (MM/DD/YY) in the To text box
  5. In the Operation drop-down list, select an operation for the scheduled task to perform. HTTPRequest is the only option.
  6. If your Web server requires a port to connect to the Web, enter it in the Port text box.
  7. In the URL text box, enter a local or remote URL to the file that the scheduled task executes. For external URLs, end the URL with a backslash.
  8. Click Submit Changes.

The scheduled task displays in the Scheduled Task table on the Schedule Task page.

The following table lists the optional settings in the Schedule Task page
Setting
Description
Username
Specifies whether the server to which the URL points requires user authentication
Password
Specifies whether the server to which the URL points requires user authentication
Request Timeout
A time, in seconds, to wait for a reply
Proxy Server
The location of the proxy server
Proxy Port
The port of the proxy server
Publish
Saves the results of the scheduled task as a static HTML file
Path
The file path to the directory in which to save the static HTML file
File
The name for the static HTML file
Resolve URL
Converts relative URLs in the static HTML file to absolute URLs
:

To modify a scheduled task:

  1. On the Schedule Task page, in the Contents column of the Scheduled Task table, click a task name. The Add/Edit Scheduled Task page displays.
  2. Change the settings.
  3. Click Submit Changes.

The modified schedule task displays in the Schedule Task page.

To delete a scheduled task:

  1. On the Schedule Task page, in the Contents column of the Scheduled Tasks table, click the Delete icon of the scheduled task.
  2. A verification message warns you that deleting the task cannot be undone. Click Yes.

The scheduled task disappears.



Banner.Novgorod.Ru