Important: Ensure the service account running the ColdFusion or Lucee service has the necessary permissions to execute the scripts or access the resources required by the scheduled task.
Before you begin
You will need:
Administrator access to the ColdFusion or Lucee Administrator interface.
The specific CFML script or command you wish to execute.
A defined schedule (e.g., daily, weekly, or at specific intervals).
Configuring the Scheduled Task
Open the ColdFusion Administrator or Lucee Administrator.
Navigate to Server settings > Scheduled Tasks.
Click Schedule New Task(or the equivalent button to create a new task).
Enter a descriptive name for the task.
Select the type of task or the specific command/script to be executed.
Enter the path to the script or the command line string. Use a placeholder like
/path/to/script.cfmif a specific path is required.Define the execution frequency and start time in the schedule settings.
Select the appropriate server or instance if you are running a multi-server environment.
Click Save or Apply to activate the task.
Confirm the result
The task will appear in the list of scheduled tasks within the administrator interface.
You can verify the status of the task by checking the "Last Run" time or the "Status" indicator in the list.
To confirm the task is executing correctly, check the application logs or the output of the script being run.
Troubleshooting
Task does not appear to run
If the task is scheduled but does not execute, verify the following:
Permissions: Ensure the system user running the ColdFusion/Lucee service has permission to execute the file at the specified path.
Path Accuracy: Verify that the file path provided in the configuration is absolute and correct.
Service Status: Ensure the ColdFusion or Lucee service is currently running.
Task fails during execution
If the task starts but fails, check the ColdFusion or Lucee error logs. These logs will contain specific details regarding script errors or connection issues that occurred during the scheduled run.
Limitations
Scheduled tasks are managed at the application server level; changes made here affect all applications running on that specific instance.
The execution of a task may consume system resources (CPU, memory) during its run time.
This procedure does not cover the creation of custom cron jobs at the OS level; it only covers tasks managed through the ColdFusion/Lucee administration interface.
