|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
We have a web site that uses cold fusion and SQL server 2000.
I'm looking to schedule some tasks and send automatic emails, but I'm not aware of how to do this. An example of what I want to do: 1. check the database every week to see if some user has not logged in. 2. send him an email. How can I automate this entire chore so I don't need to do it manually every week? Thanks. ![]()
__________________
We can help export your products http://www.GIAgroup.com/ |
|
#2
|
|||
|
|||
|
You can create scheduled tasks through the ColdFusion administrator interface. Just point it to a CF file or executable, tell it when you want it to run, and it'll run it at that time. You can also do this programmatcally with the
<cfschedule> tag. |
|
#3
|
|||
|
|||
|
Thanks kiteless. You've been a wonderful help once again!
No one else seems to answer my questions... hehe ![]() |
|
#4
|
|||
|
|||
|
Follow up.........
Using the CF admin interface, i schedule a task and it seems to work the first time. But i told it to redo the task every 10 min and it doesnt do it. I waited half an hour... the settings for task refresh is at 10 min too. The page is working fine because it works the first time i tell the task to run. Any suggestions what's the problem? |
|
#5
|
|||
|
|||
|
What version of CF are you on? Have you set the start and end times for your task? I think these are required. If you want it to fire every 10 minutes all day, you probably want something like: start at 00:10 (10 after midnight) and finishing at 23:50 (10 til midnight).
|
|
#6
|
|||
|
|||
|
I'm using CF 5.
The settings I have used are: Daily every 10 minutes from 12:00:00 to 15:00:00 This is just for testing. However, it doesn't seem to function. It only runs once when I press Go on the admin interface. |
|
#7
|
|||
|
|||
|
Well when you test it, is it between 12:00 and 15:00? Also, are *all* of the CF services running? I believe that all the services must be running for the scheduled tasks to fire.
|
|
#8
|
|||
|
|||
|
Yes, I am testing between those times that I've set.
Well, how do I check to see if all CF services are running? |
|
#9
|
|||
|
|||
|
On Windows you look in the services applet. Not sure how to do this on Unix/Linux but the need to check that everything is running is just as urgent.
|
|
#10
|
|||
|
|||
|
Also, do you have access to the Scheduler.log file? If so, does it have any info to help diagnose the problem?
|
|
#11
|
|||
|
|||
|
kiteless, all the cold fusion services seem to be running..
as for the log file, no information in there... only those tasks which were successfully run (i.e. when i pressed go) were logged in there. also, i thought maybe its a date conflict. we using the dd/mm/yyyy but then i changed the start date to 01/01/2004 and to end on 04/04/2004 and it still didn't send after ten minutes... in fact waited for 25 min. i'm stumped! |
|
#12
|
|||
|
|||
|
Just for fun, did you try creating the same scheduled task programmatically using the <cfschedule> tag?
|
|
#13
|
|||
|
|||
|
kiteless, sorry about the late late reply, been busy with other things..
Now how do I go about creating the cfschedule and where? I presume it just needs to run the whole cfschedule tag once and that's it... it should do its thing at intervals until the end date that I specify in the tag. |
|
#14
|
|||
|
|||
|
CFScheduler timer
In the CFSchedule, you can set how often CFSchedule will trigger. It defaults to 15 minutes, so that means that if you set the schedule for 10 minutes in the future, it will not fire because the trigger will never be reached.
So, if you want the schedule to fire, you need to either set the schedule to be greater than 15 minutes, or set the trigger to less than your schedule. In this case, since you want to fire in 10 minutes, set the trigger for every 5 minutes... But bear in mind that if you have a slow server, or you have a lot of processes on the server, setting the trigger to every 5 minutes may put a strain on your machine... Your call Ed web/gadget guru |
|
#15
|
|||
|
|||
|
I have a problem with setting times. I want set the schedule from tonight to tomorrow morning.
My cfschedule is like this: startdate="26/3/2004" starttime="22:00:00" endddate="27/3/2004" endtime="3:00:00" But I get the following error: Invalid Parameters have been passed to the scheduling service Parameter {ts '1899-12-30 22:00:00'} should earlier than parameter {ts '1899-12-30 03:00:00'} It seems to be comparing only times, not dates. I have no problem when I put endtime later than starttime. Does anyone know how to handle this? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Scheduling tasks in cold fusion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|