Skip to main content
Question

Cron expression - what wrong with this one?

  • September 19, 2023
  • 4 replies
  • 402 views

scarter
Contributor
Forum|alt.badge.img+10

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

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • September 19, 2023

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

 


david_r
Celebrity
  • 8394 replies
  • September 19, 2023

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 *

 


scarter
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • 125 replies
  • September 19, 2023

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.

scarter
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • 125 replies
  • September 19, 2023

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,