We help IT Professionals succeed at work.

CronTrigger Questions

mte01
mte01 asked
on
Medium Priority
328 Views
Last Modified: 2012-06-22
Hey experts,

 Using the org.quartz.CronTrigger class (whose doc. is found at: http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html). I have a question:
If I want an event scheduled to occur every 40 minutes, would that be its expression??

"0 0/40 * * * ?"

or would that occur after 40 minutes from the start of each hour??
Comment
Watch Question

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
no thats correct I think

Author

Commented:
>>objects

You mean, it would occur every 40 minutes..right??
i.e. if I scheduled it at 1:30 pm, it would occur at 1:40,2:20,3:00,3:40 pm...etc....right??
CERTIFIED EXPERT
Top Expert 2016

Commented:
AFAIK you can't. If Quartz can use at jobs, you may be able to do it with at
Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
> You mean, it would occur every 40 minutes..right??

yes

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
>>CEHJ

Yes, I don't want it to be this way....
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
how can a comment that is wrong assist you :)
CERTIFIED EXPERT
Top Expert 2016

Commented:
>> how can a comment that is wrong assist you :)

I was wondering that too. Perhaps you can reopen the question mte01 and reassign the points you gave objects?

Author

Commented:
>>objects,CEHJ

>> how can a comment that is wrong assist you :)

It assisted me in the manner that if a manager asked for that option later, I can tell him that this cannot be done with the available classes. Thanks for your help guys!!
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
It can be done :)

Author

Commented:
Yes, ok..(I dont know how I didn't realize that)..I would request that this question be reopened
CERTIFIED EXPERT
Top Expert 2016

Commented:
In the meantime, you can test the expression you posted and let us know if it schedules *every forty minutes* and at no other time ;-)

Author

Commented:
>>CEHJ

Yes, I had already tried it & it worked...
CERTIFIED EXPERT
Top Expert 2016

Commented:
It's barely 40 minutes since you posted the question ;-)

Author

Commented:
>>CEHJ

I am working on an exisitng project that uses CronTrigger & that tells me when the next time of each execution is. I scheduled it at 1:30 pm my time, it executed at 1:40 pm, and told me that its next execution is 2:20 pm
CERTIFIED EXPERT
Top Expert 2016

Commented:
OK - i'm wrong then ;-)
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
> OK - i'm wrong then ;-)

If you haven't actually used Quartz I'd suggest you don't make comments on what it cannot do, all  that does is mislead people.

CERTIFIED EXPERT
Top Expert 2016

Commented:
The question was about cron, not Quartz
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
ROTFL, helps to actually read the question before posting. It has nothing to do with cron.

Author

Commented:
>>Netminder

If you read the question carefully, you'll see that these two questions are different (this one talk about the trigger at the beginning of an hour - the other one talks about the trigger at a caculated time starting from now).
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
thats right, the two are different.
And CEHJ's comment is wrong.

Author

Commented:
>>objects

Yes, I would request the question also to be reopened so I can redistribute the points.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
What about the points? This question is *not* the same as the other, what makes you think it is? (And why would someone ask the same question twice anyway)
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Generally it is twice at the same time isn't it, not asking it again after its been answerd.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
:)

Author

Commented:
Thanks Netminder...
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*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.