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

Attributes

Attribute Req/Opt Default Description
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
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"
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
No
  • Yes: resolve links in result page to absolute references
  • No
port
Optional
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
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.

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">

Comments