We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Scheduling a New Work using cfschedule

Medium Priority
324 Views
Last Modified: 2012-05-11
I want to schedule a JOB programatically to check if schedule for specified action exists, use that else create a new ione and execute immediately if time is more than 9:00 am for today else trigger every weekday to trigger in the morning 9:00 am
Comment
Watch Question

I had addressed issues like this in the past by creating a task table in the db with a startdate, status and httpcmd field to store the info to execute.
THen i just have one scheduled task called CFTASKS which i run every 5 minutes that checks for a task to be run .
This solution is very powerfull and can be used for reporting and history of tasks run etc...
This will also not clutter up the cf server with tons of singelton tasks
CERTIFIED EXPERT

Author

Commented:
Can you show me some sample code that might help
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
CERTIFIED EXPERT

Author

Commented:
Thanks for the Sample! I just had a talk with my senior and he said we can cannot create a New Table so we have to find solution for this!

My idea was like this

1. Run a query, Loop over the query

2. Make conditions like today's date and check for its value to today's date and more than 9:00 AM

My queries!

1. where should i place my cfschedule code in which file and how it will find when to run the file
2. i do not have access to cfdmin, how do i know it runs

3. i need to run it weekly, so i must run it on everyday so whosoever's date come today and checks that its been 7 days long, send him an email

does my question makes sense
CERTIFIED EXPERT

Author

Commented:
i see you have not used the cfschedule anywhere rather than you have just used cfhttp, can i know why and can you explain the bits in this
CERTIFIED EXPERT

Author

Commented:
Any Update on this,

I have anotehr uestion, I am able to use the cfschedule successfully, but how my cfschedule knows which ID to run for !

Like it ahs to run every 7 seven days, and i have the ID as dynamic which is different.

Suppose me as ID 1, you as ID 2, so for me today + 7 days it shouild run and for you your ID + 7 days it should run, how do i pas the dyamic ID to it and how do i let cfschedule knows which to refer
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.