What is corresponding Cron expression to fire in every X seconds, where X > 60?

Posted by giolekva on Stack Overflow See other posts from Stack Overflow or by giolekva
Published on 2010-06-08T09:53:44Z Indexed on 2010/06/08 10:02 UTC
Read the original article Hit count: 162

Filed under:
|
|

I want my jobs to execute in every X seconds, there's one to one matching between job and X. Also during runtime there can be registered new jobs with their own intervals.

I've tried to write cron expression for such scenarios, but in documentation there's written that value of seconds can't be more than 69. So cron expression like this: "0/63 * * * * ?" isn't valid.

At first sight solution of that problem seemed to be expression like this: "0/3 0/1 * * * ?", but it means completely different thing: trigger job in every three second of every minute.

Can you suggest what is the right solution (cron expression) for that? I know I could use just simple timers, but I've to use cron jobs using Quartz.

© Stack Overflow or respective owner

Related posts about java

Related posts about cron