| Author |
Cron expression : run every midnight 23:59:59
|
Saurabh Pillai
Ranch Hand
Joined: Sep 12, 2008
Posts: 449
|
|
|
Is there any difference between 59 59 23 * * * and 59 59 23 * * ?
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9955
|
|
I didn't think a question mark was allowed in a crontab file. I did a quick google, and found there is a cron extension that allows it in the first four positions.
I'm really not sure what would happen if you put it in the last spot.
What OS/Cron are you using?
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4761
|
|
Saurabh Pillai wrote:Is there any difference between 59 59 23 * * * and 59 59 23 * * ?
Yes. Apologies for stating the bleedin' obvious, but one has five components and the other has 6.
And what that means almost certainly is that one form is invalid (I suspect the first).
Also: what does this have to do with Java?
Winston
|
Isn't it funny how there's always time and money enough to do it WRONG?
|
 |
Saurabh Pillai
Ranch Hand
Joined: Sep 12, 2008
Posts: 449
|
|
|
It is Windows 7. and I use http://www.quartz-scheduler.org/api/2.1.0/org/quartz/CronExpression.html , that is why I thought to post it to Java forum.
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9955
|
|
Winston Gutkowski wrote:
Saurabh Pillai wrote:Is there any difference between 59 59 23 * * * and 59 59 23 * * ?
Yes. Apologies for stating the bleedin' obvious, but one has five components and the other has 6.
I assumed the two cron expressions were
59 59 23 * * *
and
59 59 23 * * ?
both have six components. But it is hard to tell from the original post which is the correct interpretation.
Also, I moved the thread to General Computing.
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4761
|
|
Well, for future reference, please TellTheDetails (←click), because that makes a huge difference.
From what I can see, the CronExpression class requires 6 fields (standard Unix cron only has 5), and the ? in the final one (which I took to be part of your question) means 'no specific value', which I suspect equates to the same thing as *; but not having used the system, I can't be sure.
My advice: suck it and see.
Winston
|
 |
 |
|
|
subject: Cron expression : run every midnight 23:59:59
|
|
|