How to create a cron job for every April 1st?

Elif Alverson April 27, 2017

Hello, 

I am trying to create a cron job to schedule a task for every year on April first and I try to use " 0 0 6 1 Apr * " , but it does not work?

What am I missing? 

Thank you.

 

Elif

1 answer

1 accepted

3 votes
Answer accepted
JohnsonHoward
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.
April 27, 2017

Try this:

0 0 12 1 4 ? *

Elif Alverson April 27, 2017

It works. So this will create an Jira issue every year 1st of April at 12am, correct?

Like Irina Zagarina likes this
JohnsonHoward
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.
April 28, 2017

Correct, that CRON expression translates to the 1st of April every year at 12am. 

Elif Alverson April 28, 2017

Thank you very much.

Glen Cochrane December 21, 2022

@Elif Alverson 
The solution above would actually be 12 PM, not 12 AM.

This would be yearly on April 1 at 12 AM:
0 0 0 1 4 ? *

Also, keep in mind Atlassian CRON run on UTC :)

Suggest an answer

Log in or Sign up to answer