Forums

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

Biannual CRON job

Matt Lane
Contributor
September 29, 2021

I want to automate a task to be created twice a year. Once on 1st May and once on 1st November, at 12:45am UTC.

I have used the following CRON expression and I think this is correct, but would really appreciate confirmation?

0 45 0 1 5,11 ? *

 

Thank you.

4 answers

2 accepted

1 vote
Answer accepted
said kouzibry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2021

Your expression is correct,

This is how I would do it : 0 45 0 1 5/6 ? *

0 : midnight

45 : minutes

0 : seconds

1 : first day of month

5/6 : fifth month of each 6 month cycle (May, November)

? : Day of week (ignored)

* : every year

Matt Lane
Contributor
September 30, 2021

Interesting take. Thanks kouzibry

Like said kouzibry likes this
1 vote
Answer accepted
Kishan Sharma
Community Champion
September 29, 2021

Hi @Matt Lane The CRON expression is correct, it will run on 1st May and 1st November every year.

Matt Lane
Contributor
October 3, 2021

Thanks Kishan

Like Kishan Sharma likes this
2 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
September 29, 2021

Hi @Matt Lane there are online tools and you can use them to validate your query

Matt Lane
Contributor
September 30, 2021

Thanks Martin

0 votes
Selcuk Tayar December 7, 2023

Hello guys, 

can you help me define a cron expression for 01.01 and 01.06 of every year ?

Thank you in advance.

Suggest an answer

Log in or Sign up to answer