ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old January 28th, 2004, 05:38 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
Question Scheduling tasks in cold fusion

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/

Reply With Quote
  #2  
Old January 28th, 2004, 11:30 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
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.

Reply With Quote
  #3  
Old January 29th, 2004, 07:28 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
Thumbs up

Thanks kiteless. You've been a wonderful help once again!
No one else seems to answer my questions... hehe

Reply With Quote
  #4  
Old January 29th, 2004, 09:16 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
Post

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?

Reply With Quote
  #5  
Old January 30th, 2004, 10:45 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
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).

Reply With Quote
  #6  
Old February 1st, 2004, 06:01 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
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.

Reply With Quote
  #7  
Old February 1st, 2004, 08:26 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
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.

Reply With Quote
  #8  
Old February 1st, 2004, 09:18 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
Yes, I am testing between those times that I've set.
Well, how do I check to see if all CF services are running?

Reply With Quote
  #9  
Old February 1st, 2004, 10:02 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
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.

Reply With Quote
  #10  
Old February 1st, 2004, 10:19 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
Also, do you have access to the Scheduler.log file? If so, does it have any info to help diagnose the problem?

Reply With Quote
  #11  
Old February 1st, 2004, 11:18 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
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!

Reply With Quote
  #12  
Old February 2nd, 2004, 11:29 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,480 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 33 m 17 sec
Reputation Power: 42
Just for fun, did you try creating the same scheduled task programmatically using the <cfschedule> tag?

Reply With Quote
  #13  
Old February 9th, 2004, 07:24 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 36 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 58 sec
Reputation Power: 5
Question

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.

Reply With Quote
  #14  
Old March 25th, 2004, 08:29 PM
tech_ed tech_ed is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 tech_ed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #15  
Old March 26th, 2004, 06:58 PM
philinvan philinvan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 philinvan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Scheduling tasks in cold fusion


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump