Now this might be a very vague question but how reliable are scheduled tasks? For example if I setup a task to do something everyday at 3pm, and assuming there are no errors in the code, will ColdFusion always make sure it runs 3pm everyday?
-
2I've found the ColdFusion scheduler to be very reliable. – Jas Panesar Jul 04 '11 at 17:19
5 Answers
We used to use scheduled tasks to run stuff weekly, daily, hourly and per minute and per second. The run per less than minute we had to hack the neo-cron.xml
file and overall it worked very well until ColdFusion 9.0.1 - see here - and then we had to move out tasks that ran more frequently than once a minute to another scheduler.
We decided on VisualCron and haven't looked back. Unlike CF scheduling, VisualCron allow us run command line tasks rather then only hitting a URL which can be unnecessary sometimes.
CF10 is apparently coming with big changes to the scheduled task engine, so it should be interesting to see what they improve. But for tasks with intervals greater than one minute the current CF scheduling engine is very reliable.
Hope that helps!

- 1
- 1

- 12,316
- 9
- 38
- 55
I will say YES it will run at every 3:00 PM if it is schedule and your COLDFUSION server is RUNNING (really important ;) ). I use it lot. Almost 25 schedules in one of my project to generate daily report and email statistics. On schedule pages make sure your page doesn't timed out as this error will not catch by ColdFusion onError method if you are logging/sending email on error either you will never know that script wasn't run properly.

- 1,969
- 1
- 18
- 32
-
1If you setup your scehduled jobs under a custom application then you can configure `onError()` as you require. – Ciaran Archer Jul 04 '11 at 07:06
-
-
Yes, we actually have all our scheduled jobs under a different application from our main website, and if they fail we catch the error details and email them to the team so they can take whatever action is required. Be sure to nail down some kind of IP restriction etc. if this is the way you go. TBH I wish CF could be run from the command line to avoid this issue of punching a hole in web application security just so the scheduler can run a particular URL. – Ciaran Archer Jul 04 '11 at 11:18
-
Hi Ciaran, I was talking about timeout issue. Timeout error will not catch on onError method as thread already run for enough time and ColdFusion will not spend more time to execute code onError function to send email etc. – Pritesh Patel Jul 04 '11 at 11:32
-
Hi Pritesh, I don't think this is correct, at least in CF 9.0.1. The timeout exception will be handled by `onError()` just like any other exception. I've done a quick experiment - see https://gist.github.com/1063287 and try it for yourself. – Ciaran Archer Jul 04 '11 at 12:34
From my experience they are very reliable. We use them for many automated tasks that run daily and weekly. Have never let us down.
As a check, add an email in the programs, so that if you get your daily email, you know the scheduled task ran. If not something went wrong, but unless your webserver or coldfusion stop, once its all setup it should be smooth sailing.

- 4,623
- 7
- 39
- 76
CF will always run when you setup your schedule task no matter it catch error. It means, next schedule task will be run as interval time when the previous task caught error.

- 13,309
- 42
- 142
- 227
From my experience, they are extremely reliable.
How to Tell if the Task Ran:
For Railo server, one way to see if the task ran or get an idea of status of the task is to check the "scheduler.log". This is normally found in the /WEB-INF/railo/logs directory. Here you can see if the task executed or not, if it timed out, etc.
For CF server, you can set an array of scheduled tasks by creating an object as shown below, then just loop through or cfdump it:
<cfset arySchedTasks = createobject("java","coldfusion.server.ServiceFactory").getCronService().listall() />

- 1,825
- 2
- 17
- 12