<cfschedule>

Provides a programmatic interface to the 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 in order to populate the data on the page.

This tag cannot have a body.

This tag is also supported within <cfscript>

<cfschedule action=delete|run|update|list|resume|pause serverpassword=string hidden=boolean readonly=boolean task=string operation=string paused=boolean file=string path=string startdate=any starttime=any url=string publish=boolean enddate=any endtime=any interval=string requesttimeout=any username=string password=string proxyserver=string proxyuser=string proxypassword=string useragent=string resolveurl=boolean port=any proxyport=any result=string autodelete=boolean unique=boolean >
Attribute Description
action
string, required
  • delete: deletes the specified task
  • update: updates an existing task or creates a new task, if one with the name specified by the task attribute does not exist
  • run: executes the specified task
  • list: list all scheduled tasks defined
  • pause: pause execution of the defined scheduled task
  • resume: resume execution of a paused scheduled task
serverpassword
string, optional

allow you to access filesystem, also when access is denied for your context

hidden
boolean, optional

if set to true the scheduled task is not displayed in the Lucee Administrator.

readonly
boolean, optional

if set to true the scheduled task can not be modified or deleted in the Lucee Administrator.

task
string, optional

The name of the task to delete, update, or run.

operation
string, optional

The type of operation the scheduler performs when executing this task.

  • HTTPRequest: make a http(s) request to the url provided
paused
boolean, optional

if set to true the scheduled task is paused.

file
string, optional

Required with publish ='Yes' A valid filename for the published file.

path
string, optional

Required with publish ='Yes' The path location for the published file.

startdate
any, optional

Required when action ='update'. The date when scheduling of the task should start.

starttime
any, optional

Required when creating tasks with action = 'update'. Enter a value in seconds. The time when scheduling of the task starts.

url
string, optional

Required when action = 'update'. The URL to be executed.

publish
boolean, optional

Specifies whether the result should be saved to a file.

enddate
any, optional

The date when the scheduled task ends.

endtime
any, optional

The time when the scheduled task ends. Enter a value in seconds.

interval
string, optional

Required when creating tasks with action = 'update'. Interval at which task should be scheduled. Can be set in seconds or as Once, Daily, Weekly, and Monthly. The default interval is one hour. The minimum interval is 10 seconds.

requesttimeout
any, optional

Customizes the requestTimeOut for the task operation. Can be used to extend the default timeout for operations that require more time to execute. Value in seconds.

username
string, optional

Username if URL is protected.

password
string, optional

Password if URL is protected.

proxyserver
string, optional

Host name or IP address of a proxy server.

proxyuser
string, optional

User name to provide to the proxy server.

proxypassword
string, optional

Password to provide to the proxy server.

useragent
string, optional

User agent request header.

Introduced: 6.0.0.172

resolveurl
boolean, optional

Specifies whether to resolve links in the result page to absolute references.

port
any, optional

The port number on the server from which the task is being scheduled. Default is 80. When used with resolveURL, the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document.

proxyport
any, optional

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

result
string, optional

Return variable name of action list. Result attribute doesn't work with other actions.

Alias: returnvariable

autodelete
boolean, optional

if set to true, the scheduled task get deleted when there is no possible future execution.

unique
boolean, optional

if set to true, the scheduled task is only executed once at time.if a task is still running from previous round no new task is started.

Examples

Syntax for cfschedule

<cfschedule
    action="update"
    task="test"
    operation="HTTPRequest"
    startDate="6/02/2019"
    startTime="12:00 AM"
    url="https://www.test.com/schedule_task/test.cfm"
    interval="daily"
    publish = "Yes"
    file = "myfile.log"
    path = "#expandPath('./')#" />

Action List

<cfschedule action="list" returnvariable="res">

Action Run

<cfschedule action="run" task="taskOne">

Action Pause

<cfschedule action="pause" task="taskOne">

Action Resume

<cfschedule action="resume" task="taskOne">

Action Delete

<cfschedule action="delete" task="taskOne">

See also