Question

Cron expression - what wrong with this one?

  • 19 September 2023
  • 4 replies
  • 108 views

Userlevel 1
Badge +7

Hi forum,

 

I'm very new to FME Flow. I need to set up a schedule using cron expression for 07:00 Monday to Saturday, all year. I've entered...

 

0 7 * * 1-6

 

However FME Flow gives a message: "Invalid cron expression: 0 7 * * 1-6"

 

I cant see what's wrong with it. Any thoughts?

 

See attached image.

Swk_cronThanks,

Stuart

 

 


4 replies

Userlevel 6
Badge +34

Please see https://community.safe.com/s/article/writing-cron-expressions-to-schedule-fme-server-jo

I think it should be

0 0 7 ? * MON-SAT

 

Userlevel 5

Personally, I always end up using this CRON generator, since I end up forgetting the syntax between uses: https://www.freeformatter.com/cron-expression-generator-quartz.html

Which would give you:

0 0 7 ? * MON,TUE,WED,THU,FRI,SAT *

 

Userlevel 1
Badge +7

Please see https://community.safe.com/s/article/writing-cron-expressions-to-schedule-fme-server-jo

I think it should be

0 0 7 ? * MON-SAT

 

Yes, that worked. Thank you.
Userlevel 1
Badge +7

Personally, I always end up using this CRON generator, since I end up forgetting the syntax between uses: https://www.freeformatter.com/cron-expression-generator-quartz.html

Which would give you:

0 0 7 ? * MON,TUE,WED,THU,FRI,SAT *

 

Most Google guidance I found suggested five fields:


·         minute of the hour (0-59), or leave as *

·         the hour (0-23), or leave as *

·         day of the month (1-31), or leave as *

·         month (1-12), or leave as *

·         day of the week (0-6 where 0 or 7 is Sunday), or leave as *


Thus my effort of 0 7 * * 1-6



I didn’t realise Flow wanted it’s cron expressions to be a bit more expanded that that.



Thanks,

Reply