CFSCHEDULE  
Description

Provides a programmatic interface to the ColdFusion scheduling engine. You can run a page at scheduled intervals, with the option to write out static HTML pages. This lets users access pages that publish data, such as reports, without waiting while a database transaction is performed to populate the page.

You register ColdFusion scheduled events in the ColdFusion Administrator. You can disable cfschedule execution in the Administrator.

Information that the user supplies includes the scheduled ColdFusion page to execute, the time and frequency of execution, and whether to publish the task output. If the output is published, a path and file are specified.

The event submission and its success or failure status is written to the \cfusion\log\schedule.log file.

 
Category

Variable manipulation tags

 
Syntax
    <cfschedule 
   action = "update"
   task = "taskname"
   operation = "HTTPRequest"
   file = "filename"
   path = "path_to_file"
   startDate = "date"
   startTime = "time"
   url = "URL"
   publish = "Yes" or "No"
   endDate = "date"
   endTime = "time"
   interval = "seconds"
   requestTimeOut = "seconds"
   username = "username"
   password = "password"
   resolveURL = "Yes" or "No"
   proxyServer = "hostname"
   port = "port_number"
   proxyPort = "port_number">
 
<cfschedule 
   action = "delete" 
   task = "TaskName">
 
<cfschedule 
   action = "run" 
   task = "TaskName">

  
 
See also

cfcookie, cfparam, cfregistry, cfsavecontent, cfset

 
Usage

You cannot use cfschedule and apply Secure Sockets Layer (SSL) to an application.

 
Example
<h3>cfschedule Example</h3>
<p>cfschedule provides a programmatic interface to the ColdFusion scheduling
engine. You can run a specified page at scheduled intervals with the
option to write out static HTML pages. This lets you offer users access 
to pages that publish data, such as reports, without forcing users to
wait while a database transaction is performed to populate the data 
on the page.
<p>View-only-example</p>
<cfschedule action = "update"
   task = "TaskName" 
   operation = "HTTPRequest"
   url = "http://127.0.0.1/playpen/history.cfm"
   startDate = "8/7/98"
   startTime = "12:25 PM"
   interval = "3600"
   resolveURL = "Yes"
   publish = "Yes"
   file = "sample.html"
   path = "c:\inetpub\wwwroot\playpen"
   requestTimeOut = "600">
ACTION  
  Required
 
  • delete: deletes task
  • update: creates task, if one does not exist
  • run: executes task
TASK  
  Required
 

Name of task.

OPERATION  
  Required if action = "update"
 

Task that scheduler performs. For static page generation, the only option is "HTTPRequest".

FILE  
  Required if publish = "Yes"
 

Filename for the published file.

PATH  
  Required if publish = "Yes"
 

Path location for the published file.

STARTDATE  
  Required if action = "update"
 

Date when task scheduling starts.

STARTTIME  
  Required if action = "update"
 

Time when scheduling of task starts (seconds).

URL  
  Required if action = "update"
 

URL to execute.

PUBLISH  
  Optional
 
Default value: "No"
  • Yes: save the result to a file
  • No
ENDDATE  
  Optional
 

Date when scheduled task ends.

ENDTIME  
  Optional
 

Time when scheduled task ends (seconds).

INTERVAL  
  Required if action = "update"
 
Default value: "One hour"

Interval at which task is scheduled.

  • number of seconds (minimum is 60)
  • once
  • daily
  • weekly
  • monthly
REQUESTTIMEOUT  
  Optional
 

Can be used to extend the default timeout period.

USERNAME  
  Optional
 

Username, if URL is protected.

PASSWORD  
  Optional
 

Password, if URL is protected.

PROXYSERVER  
  Optional
 

Host name or IP address of a proxy server.

RESOLVEURL  
  Optional
 
Default value: "No"
  • Yes: resolve links in result page to absolute references
  • No
PORT  
  Optional
 
Default value: "80"

Server port number from which the task is scheduled. IF resolveURL= "yes", retrieved document URLs that specify a port number are automatically resolved, to preserve links in the retrieved document.

PROXYPORT  
  Optional
 
Default value: "80"

Port number on proxy server from which task is requested. When used with resolveURL, URLs of retrieved documents that specify a port number are automatically resolved, to preserve links in retrieved document.