wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Quartz Cron Expression  -- need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Quartz Cron Expression  -- need help" Watch "Quartz Cron Expression  -- need help" New topic
Author

Quartz Cron Expression -- need help

anirban sarkar
Greenhorn

Joined: Dec 04, 2008
Posts: 7
Hi,

I'm facing a problem with Quartz scheduler.In my J2EE application i'm using Quartz for job scheduling.
I need cron expressions for the job set mentioned bellow:

Set 1
i)The job will run on every N months where N is a positive integer.
ii)Staring from any month choosen from Jan to Dec of the current year
iii)run on N th day of each month where N varries from 1 to 31.if the th day doesn't exist in the month consider the last day ohat month.
iv) Run time in HH:MM am pm format

Set 2
i)The job will run on every N months where N is a positive integer.
ii)Staring from any month choosen from Jan to Dec of the current year
iii)run on first monday of month
iv) Run time in HH:MM am pm format

Set 3
i)The job will run on every N months where N is a positive integer.
ii)Staring from any month choosen from Jan to Dec of the current year
iii)run on last day of month
iv) Run time in HH:MM am pm format

User can choose one of the above 3 set.

I need your help . It's very urgent.

Thanks
Anirban
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Originally posted by anirban sarkar:


I need your help . It's very urgent.



Have you tried to crate any expression so far .

We will help you , If you ShowSomeEfforts !

BTW, Take a look at this Quartz JavaDoc about CronExperssion, It has great information about How complicated Schedule can be written in easy way !!


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
anirban sarkar
Greenhorn

Joined: Dec 04, 2008
Posts: 7
Hi

I havn't found any expression to create a cron trigger which will be fired on N th month interval(N=2,3,4,...)

For 5 month interval & start date= 5-Dec-2008 8:30 pm ,
I have tried with "0 30/5 20 5 12 ? *" but it didn't work.After that i got to know that 30/5 does not mean it'll run on 5 month interval basis.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Originally posted by anirban sarkar:
Hi

For 5 month interval & start date= 5-Dec-2008 8:30 pm ,
I have tried with "0 30/5 20 5 12 ? *" but it didn't work.After that i got to know that 30/5 does not mean it'll run on 5 month interval basis.


What are you incrementing by 5 is minute, 30/5, starting at 8:30, fired after each 5 minutes like 30, 35, 40, etc..

Try this,



Reads as :

Fire at 8:30 on 5th day of every next 5th month
anirban sarkar
Greenhorn

Joined: Dec 04, 2008
Posts: 7
Sorry I've tried with 5 mins interval for testing purpose.
Now giving 1/5 in month field should it fire on JAN,JUN,NOV of current year and APR,SEP of next year and so on...?I need this scenario.
anirban sarkar
Greenhorn

Joined: Dec 04, 2008
Posts: 7
Hi ,

Giving 1/5 in month field should it fire on JAN,JUN,NOV of current year and APR,SEP of next year and so on...?If no, what i'll do to implement this so that it'll be fired on 5 month interval (JAN,JUN,NOV of current year and APR,SEP of next year and so on...)?Here the start month is JAN.

Thanks
Anirban
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

I'm not sure, whether this works they way you want, but as per the documentation and my knowledge is concerned it should fire on every 5 month.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Quartz Cron Expression -- need help
 
Similar Threads
Difficult trying to convert a String to a Date
Some cron/crontab stuff
Calendar weirdness...
Quartz Scheduler that runs every x months
Quartz scheduler or Timer task?