Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Quartz Cron Expression

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting problem in writing a cron Exp that triggers every monday,tuesday,wednesday and every 2nd and 4th Thrusday.

I just wrote

0 0 0 0 0 MON-WED,THU#2,THU#4 ?

But this does not work.


 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of quartz are you using and what's the error message you're getting?
 
santosh joshi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using quartz 1.5.2,

Getting no Error message, as the expression compiles successfully, outputting only monday, tuesday and wednesday,
and ignores the thrusdays's value.

seems THU#2,THU#4 creates problem
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Javadoc for that version seems to indicate that the # syntax only works with numerics e.g. 6#3
 
santosh joshi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"0 0 0 ? * 2-3,5 *"

returns

Mon Jan 17 00:00:00 IST 2011
Tue Jan 18 00:00:00 IST 2011
Thu Jan 20 00:00:00 IST 2011

"0 0 0 ? * 2-3,5#4 *"
returns

Mon Jan 24 00:00:00 IST 2011
Mon Feb 28 00:00:00 IST 2011
Mon Mar 28 00:00:00 IST 2011
Mon Apr 25 00:00:00 IST 2011

so this returns wrong result

 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably a quartz bug, it's up to at least 1.7.3+ now, I'd perhaps upgrade
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This seems related to this bug. It doesn't seem to be fixed in the latest version. Maybe you should use a different trigger for every 2nd Thursday of the month.
 
santosh joshi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Guys,

I am using a different trigger for this purpose

Thanks

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic