[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 759
  • Last Modified:

Scheduled Task

Hello,

I need to schedule a task to run on the last day of each month at 11.59pm.

I have been into the Administrator to see how to set this up but there doesn't seem to be enough options to do what I need to do.

So first: is this possible and if so how do I go about setting it up?

These are the fields in the schedule form in the administrator that i am using. Perhaps someone can help me fill in the blanks?

Task Name: updateRetainerHours
Duration: Start Date: "blank" End Date (optional) "blank"
Frequency: Recurring: Monthly at "?????"

Thanks in advance

Chris
0
chrissp26
Asked:
chrissp26
  • 2
  • 2
1 Solution
 
SidFishesCommented:
Check out cfschedule

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-a30.htm

It has more flexibility than setting up a task in cfadmin
0
 
chrissp26Author Commented:
Thanks for that. I had a look at it earlier.

As I understand it, the date i specify the task to start is the date the task will be carried out each month.

So if I started the task on 31.05.2006 then the task will run on the 31st of each month. So what happens when there are not 31 days in a month? Or am I thinking to deeply into the whole thing?

Cheers

Chris
0
 
SidFishesCommented:


adapt this
http://www.johnwbartlett.com/CF_tipsNtricks/index.cfm?TopicID=44

save as lastdayTask.cfm
<CFIF  Day(Now()) NOT EQUAL DaysInMonth(Now())>
  <CFABORT>
<cfelse>
<cfquery name="lastdayupdate" datasource="mydb">
<update sometable set somedata = 1 where id = someid
</cfquery>
</CFIF>

then run lastDayTask.cfm every day at a time you want. the query will only run if it's the last day of the month.

0
 
chrissp26Author Commented:
Cool, I thought about something like that but wasn't sure if CFSchedule could do it better.

Thanks for your help.

All the best

Chris

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now