Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Helping setting up cron-based nifi processor

avatar
Super Collaborator

I'm trying to setup a nifi processor to run once daily, using the 'cron' option under scheduling.

Under "run schedule", I put "01 18 * * * ?" , which should be 6:01pm (I couldn't get nifi to accept it without the question mark).

But this causes the scheduler to run on the hour, every hour.

Can someone please help me with my syntax here?

1 ACCEPTED SOLUTION

avatar
Super Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
18 REPLIES 18

avatar
Super Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Super Mentor

NiFi does not use a linux cron. It uses a Quartz cron/scheduler.

avatar
Super Collaborator

When I enter "0 0 18 * * * ?", I get this error message: "Scheduling Period '0 0 18 * * * ?' is not a valid cron expression: '?' can only be specified for Day-of-Month or Day-of-Week"

However, "0 0 18 * * ? *" seems to work.

What is the difference between the meaning of "*" and "?" ?

avatar
Super Mentor

@Zack Riesland

There are seven fields; however, the seventh field is optional. So you are correct.

so both " 0 0 18 * * ? " and " 0 0 18 * * ? * " are valid.

The below is from http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html

----------------

  • * (“all values”) - used to select all values within a field. For example, “” in the minute field means *“every minute”.
  • ? (“no specific value”) - useful when you need to specify something in one of the two fields in which the character is allowed, but not the other. For example, if I want my trigger to fire on a particular day of the month (say, the 10th), but don’t care what day of the week that happens to be, I would put “10” in the day-of-month field, and “?” in the day-of-week field. See the examples below for clarification.

-----------------

so only fields 4 and 6 will accept ?.

Thanks,

Matt

avatar
Explorer

Hi @zack_riesland 

can you provide corn expression for this timing 12:00PM and 11:40AM 

avatar
Super Mentor

@hargav  
It is not possible to create single Quartz cron that will schedule at 12:00:00 PM and 11:40:00 AM each day.

However, the following would execute at 11:40:00AM and 12:40:00PM every day

0 40 11,12 * * ?

 
and following would execute at 11:00:00AM, 11:40:00AM, 12:00:00PM, and 12:40:00PM

0 0,40 11,12 * * ?

 or

0 0/40 11,12 * * ?


Hope this helps you,

Matt

avatar
Explorer

Hi @MattWho 

I want corn driven expression for 11:40 am separate and I want corn driven expression for 12:00pm separate

Please send those expressions

avatar
Super Mentor

@hargav 

NiFi processor scheduled every day at 11:40AM:

0 40 11 * * ? *


NiFi processor Scheduled every day at 12:00PM:

0 0 12 * * ? *

 

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

avatar
Explorer

Hi @MattWho  

I was used below corn expression for merge record but the data  was not went to the queue in nifi platform ,We need to change any configuration in merge record ?

please suggest me any solution 

0 40 11 * * ? *