You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Erwin Hogeweg <er...@me.com> on 2020/02/11 15:38:47 UTC

k-4.2.8 scheduler:reschedule cron syntax?

Hi,

Does anyone know what the proper syntax is to reschedule a job from the console?

I have this job:

	karaf@root()> scheduler:list
	Name             │ Schedule
	─────────────────┼────────────────────
	MyRefreshJob.357 │ cron(0 59 05 * * ?)

According to the manual (https://karaf.apache.org/manual/latest/#_update_scheduling_of_an_existing_job <https://karaf.apache.org/manual/latest/#_update_scheduling_of_an_existing_job>)

The reschedule command should look something like:

	karaf@root()> scheduler:reschedule --cron "0 26 10 * * *” MyRefreshJob.357                                                                                                                                          

But that throws an exception. 

	[Karaf local console user karaf] ERROR org.apache.karaf.shell.support.ShellUtil - Exception caught while executing command
	java.lang.NullPointerException
		at org.apache.karaf.scheduler.core.QuartzScheduler.reschedule(QuartzScheduler.java:263)
		at org.apache.karaf.scheduler.command.Reschedule.execute(Reschedule.java:80)
		at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)

I have tried several other combinations but I haven’t found anything that works yet.

Any help is appreciated.


Cheers,

Erwin


Re: k-4.2.8 scheduler:reschedule cron syntax?

Posted by Erwin Hogeweg <er...@me.com>.
JB,

> I confirm it works fine.
> 
> Maybe it was the initial cron string 

Yeah, or a typo in the job name. I dunno. I haven’t been able reproduce it. 

Sorry about the noise. 

Erwin



Re: k-4.2.8 scheduler:reschedule cron syntax?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

I confirm it works fine.

Maybe it was the initial cron string ?

Regards
JB

> Le 11 févr. 2020 à 17:16, Erwin Hogeweg <er...@me.com> a écrit :
> 
> Thanks Francois.
> 
> It works here as well now. Strange. I’ll keep an eye on it and see if I can reproduce it.
> 
> 
> 	karaf@root()> scheduler:reschedule --cron "0 26 10 * * ?” MyRefreshJob.383 
> 	karaf@root()> scheduler:list
> 	Name             │ Schedule
> 	─────────────────┼────────────────────
> 	MyRefreshJob.383 │ cron(0 26 10 * * ?)
> 
> Erwin
> 
> 
>> On Feb 11, 2020, at 11:02, Francois Papon <francois.papon@openobject.fr <ma...@openobject.fr>> wrote:
>> 
>> Hi,
>> 
>> I tested in a fresh Karaf 4.2.8 and it works well:
>> 
>> karaf@root()> scheduler:list
>> Name                       │ Schedule
>> ───────────────────────────┼────────────────────
>> decanter-collector-jmx.122 │ cron(0 59 05 * * ?)
>> karaf@root()> scheduler:reschedule --cron "0 55 05 * * ?" decanter-collector-jmx.122
>> karaf@root()> scheduler:list
>> Name                       │ Schedule
>> ───────────────────────────┼────────────────────
>> decanter-collector-jmx.122 │ cron(0 55 05 * * ?)
>> 
>> May be it's your cron options.
>> 
>> regards,
>> François
>> fpapon@apache.org <ma...@apache.org>
>> Le 11/02/2020 à 16:38, Erwin Hogeweg a écrit :
>>> scheduler:reschedule --cron "0 26 10 * * *” 
> 


Re: k-4.2.8 scheduler:reschedule cron syntax?

Posted by Erwin Hogeweg <er...@me.com>.
Thanks Francois.

It works here as well now. Strange. I’ll keep an eye on it and see if I can reproduce it.


	karaf@root()> scheduler:reschedule --cron "0 26 10 * * ?” MyRefreshJob.383 
	karaf@root()> scheduler:list
	Name             │ Schedule
	─────────────────┼────────────────────
	MyRefreshJob.383 │ cron(0 26 10 * * ?)

Erwin


> On Feb 11, 2020, at 11:02, Francois Papon <fr...@openobject.fr> wrote:
> 
> Hi,
> 
> I tested in a fresh Karaf 4.2.8 and it works well:
> 
> karaf@root()> scheduler:list
> Name                       │ Schedule
> ───────────────────────────┼────────────────────
> decanter-collector-jmx.122 │ cron(0 59 05 * * ?)
> karaf@root()> scheduler:reschedule --cron "0 55 05 * * ?" decanter-collector-jmx.122
> karaf@root()> scheduler:list
> Name                       │ Schedule
> ───────────────────────────┼────────────────────
> decanter-collector-jmx.122 │ cron(0 55 05 * * ?)
> 
> May be it's your cron options.
> 
> regards,
> François
> fpapon@apache.org <ma...@apache.org>
> Le 11/02/2020 à 16:38, Erwin Hogeweg a écrit :
>> scheduler:reschedule --cron "0 26 10 * * *” 


Re: k-4.2.8 scheduler:reschedule cron syntax?

Posted by Francois Papon <fr...@openobject.fr>.
Hi,

I tested in a fresh Karaf 4.2.8 and it works well:

karaf@root()> scheduler:list
Name                       │ Schedule
───────────────────────────┼────────────────────
decanter-collector-jmx.122 │ cron(0 59 05 * * ?)
karaf@root()> scheduler:reschedule --cron "0 55 05 * * ?" decanter-collector-jmx.122
karaf@root()> scheduler:list
Name                       │ Schedule
───────────────────────────┼────────────────────
decanter-collector-jmx.122 │ cron(0 55 05 * * ?)

May be it's your cron options.

regards,

François
fpapon@apache.org

Le 11/02/2020 à 16:38, Erwin Hogeweg a écrit :
> scheduler:reschedule --cron "0 26 10 * * *”