k-4.2.8 scheduler:reschedule cron syntax?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

k-4.2.8 scheduler:reschedule cron syntax?

Erwin Hogeweg
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 * * ?)


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

Reply | Threaded
Open this post in threaded view
|

Re: k-4.2.8 scheduler:reschedule cron syntax?

fpapon
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
[hidden email]
Le 11/02/2020 à 16:38, Erwin Hogeweg a écrit :
scheduler:reschedule --cron "0 26 10 * * *” 
François Papon
fpapon@apache.org
Yupiik - https://www.yupiik.com
Reply | Threaded
Open this post in threaded view
|

Re: k-4.2.8 scheduler:reschedule cron syntax?

Erwin Hogeweg
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 <[hidden email]> 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
[hidden email]
Le 11/02/2020 à 16:38, Erwin Hogeweg a écrit :
scheduler:reschedule --cron "0 26 10 * * *” 

Reply | Threaded
Open this post in threaded view
|

Re: k-4.2.8 scheduler:reschedule cron syntax?

jbonofre
Hi,

I confirm it works fine.

Maybe it was the initial cron string ?

Regards
JB

Le 11 févr. 2020 à 17:16, Erwin Hogeweg <[hidden email]> 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 <[hidden email]> 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
[hidden email]
Le 11/02/2020 à 16:38, Erwin Hogeweg a écrit :
scheduler:reschedule --cron "0 26 10 * * *” 


Reply | Threaded
Open this post in threaded view
|

Re: k-4.2.8 scheduler:reschedule cron syntax?

Erwin Hogeweg
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