Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

CRON

Kieron Brent
Contributor
September 18, 2024

I would like to write a CRON expression to only trigger on a weekday between the hours of 0800 and 1800 and once every 45 minutes.  I thought I had solved this using this CRON expression but it doesn't seem to work.  Any help welcome, thanks.

 

0 45 8,18 ? * 1-5

2 answers

2 accepted

2 votes
Answer accepted
Kishan Sharma
Community Champion
September 18, 2024

Hi @Kieron Brent 

Welcome to the Atlassian Community!

You can try below cron expression for your use case, since you want to use an hour range, you should use - instead of , for hour field, so that it triggers only between that hour range(i.e between 8AM -6PM)


0 0/45 8-18 ? * MON-FRI *

Kieron Brent
Contributor
September 18, 2024

I have put this in to see if it works - I will let you know

Like Kishan Sharma likes this
Kishan Sharma
Community Champion
September 19, 2024

Hi @Kieron Brent If my response was helpful, feel free to mark it as accepted; it can assist other users facing similar questions.

Like Susan Waldrip likes this
1 vote
Answer accepted
Susan Waldrip
Community Champion
September 18, 2024

Hi @Kieron Brent , welcome to the community!

(Edited to correct the expression per @Kishan Sharma's answer [he's correct] for future reference by others, thx!)

Have you tried  0 0/45 8-18 ? * MON-FRI *  ? Also, there are a couple of good sites I use for CRON expressions, crontab.guru and a Community page Constructing cron expressions for a filter expression. Hope these help!

Kieron Brent
Contributor
September 18, 2024

I will let you know a little later if this has worked - Thanks

Like Susan Waldrip likes this
Kieron Brent
Contributor
September 19, 2024

0 0/45 8-18 ? * MON-FRI * has indeed solved the problem thanks all

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events