You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Kevin Verhoeven <Ke...@ds-iq.com> on 2017/05/23 17:43:59 UTC

Scheduling Processors using Cron

I scheduled a GetFile Processor with the following cron schedule: 0 0-23/4 * * * ? on the Primary Node, which I think should mean that the Processor will get the file only at hour 0,4,8,12,16,20 on minute 0. However, when I start the processor it gets the file many times within the next few minutes.

What could be wrong with my schedule? Is it expected behavior that when I start the Processor that it will get the file? Why is it not honoring the schedule?

Any recommendations would be appreciated!

Regards,

Kevin




RE: Scheduling Processors using Cron

Posted by Kevin Verhoeven <Ke...@ds-iq.com>.
That's what I was looking for, thanks Mark!

Kevin

From: Mark Payne [mailto:markap14@hotmail.com]
Sent: Tuesday, May 23, 2017 11:11 AM
To: users@nifi.apache.org
Subject: Re: Scheduling Processors using Cron

Kevin,

NiFi is using the Quartz cron scheduler, which adds an extra field for seconds, which typical linux cron schedulers do not allow.
The breakdown of the fields can be found at [1]. So it looks like you're specifying the minute field to be "0-23/4" rather than the hour.
I think you'll want something more like "0 0 0-23/4 * * * ?"

Thanks
-Mark


[1] http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html

On May 23, 2017, at 1:43 PM, Kevin Verhoeven <Ke...@ds-iq.com>> wrote:

I scheduled a GetFile Processor with the following cron schedule: 0 0-23/4 * * * ? on the Primary Node, which I think should mean that the Processor will get the file only at hour 0,4,8,12,16,20 on minute 0. However, when I start the processor it gets the file many times within the next few minutes.

What could be wrong with my schedule? Is it expected behavior that when I start the Processor that it will get the file? Why is it not honoring the schedule?

Any recommendations would be appreciated!

Regards,

Kevin





Re: Scheduling Processors using Cron

Posted by Mark Payne <ma...@hotmail.com>.
Kevin,

NiFi is using the Quartz cron scheduler, which adds an extra field for seconds, which typical linux cron schedulers do not allow.
The breakdown of the fields can be found at [1]. So it looks like you're specifying the minute field to be "0-23/4" rather than the hour.
I think you'll want something more like "0 0 0-23/4 * * * ?"

Thanks
-Mark


[1] http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html

On May 23, 2017, at 1:43 PM, Kevin Verhoeven <Ke...@ds-iq.com>> wrote:

I scheduled a GetFile Processor with the following cron schedule: 0 0-23/4 * * * ? on the Primary Node, which I think should mean that the Processor will get the file only at hour 0,4,8,12,16,20 on minute 0. However, when I start the processor it gets the file many times within the next few minutes.

What could be wrong with my schedule? Is it expected behavior that when I start the Processor that it will get the file? Why is it not honoring the schedule?

Any recommendations would be appreciated!

Regards,

Kevin