ColdFusion provides the ability to automate tasks by running ColdFusion code at specified intervals.
There were far-reaching changes to Scheduled Tasks introduced in ColdFusion 10. The most significant change updates ColdFusion to leverage the Quartz Job Scheduling Library to support the high precision scheduling of thousands of tasks. This is continued in ColdFusion 2018.
There are two overall types of Scheduled Tasks; Server Level and Application Level. The only tasks which can be created and managed via ColdFusion Administrator are Server Level tasks. Application Level tasks are created in your ColdFusion Application(s) via code and will appear in the Application Level Tasks section here in the ColdFusion Administrator.
Add/Edit Scheduled Task
Here and in the screenshot below we are adding a Scheduled Task. The Chained Task setting is used to define dependencies between your tasks.
We can also select to save output to a file (.log
or .txt
format).
Here is the task successfully added.
Enable Cluster Setup
The purpose of clustering Scheduled Tasks is in order to provide a layer of redundancy. If one server fails we can fail over to another system for these tasks. This is an Enterprise feature only. If this setting is enabled, it is imperative to ensure that only one version of the task is running. It is important to have an empty database (DSN) set up before beginning the cluster set up.
Cluster Setup & Ready
From this page, we can also disable the cluster if necessary. Please make sure the ColdFusion user for the supplied data source has create privileges on the database. This data source will also need the create capability enabled under Allowed SQL within the data sources administration page.
Here is what the table structure looks like once it has been created.