Forums

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

jira - run cron every 2 days

Gavin
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.
July 6, 2021

Hi I'm trying to run a cron every 2 days at 9am.

I thought this would work

0 0 9/2 * * ?

 

But I'm getting those triggered at 1pm and 3pM.  I think ever 2 hrs after that.  

what am I doing wrong.

thanks

1 answer

0 votes
Jack Brickey
Community Champion
July 6, 2021

Should it be….? Haven’t tested…

0 9 */2 * *

minute hour dom month dow 

note the time is GMT so if you want local time add offset.

Gavin
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.
July 6, 2021

0 9 */2 * * says Unexpected end of expression

Gavin
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.
July 6, 2021

0 9 */2 * * ? this worked.. question does this mean the same thing?

Jack Brickey
Community Champion
July 6, 2021

Does it mean the same thing as what? As what you were looking for? I believe so but only you can say for sure via your testing. 

Gavin
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.
July 6, 2021

thanks.

is there any way to check the cron instead of edit and wait?

Jack Brickey
Community Champion
July 6, 2021

You could test out the format on minutes…

*/5 * * * *

Gavin
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.
July 7, 2021

hmm ok I have this as my cron job

0 9 */2 * * ?  - verified it from https://crontab.guru/#0_9_*/2_*_*  as supposes to be running every 2 days. However, https://support.atlassian.com/jira-software-cloud/docs/construct-cron-expressions-for-a-filter-subscription/ seems different. the 9 is a minute time and the /2 hrs.

But looks like it's running every 2 hrs.

audit log shows it running at 

6:09

8:09

10:09

so apparently atlassian is using their own version of cron.

 

so 0 9 */2 * * ? should be 0 0 9 */2 ? *  is my thinking right?

Adam Gołaszewski
Contributor
June 25, 2022

Hi, I just ran into this post. I think what you are looking for is 0 9 * * 1-7/2 which runs on every second day of the week :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events