Can I write a cron expression that does not specify any day or month?

Vandyck Lai Kai Yong
Contributor
June 23, 2021

Lately, I want to send automation that follow up with the customers everyday when the ticket had been inactive for 1 day or more.

I want to construct a cron expression that does not specify any Day-of-month or Day-of-week.

Cron table explanation.PNG

cron expression example.PNG

Source: https://support.atlassian.com/jira-software-cloud/docs/construct-cron-expressions-for-a-filter-subscription/

 

I just want to make sure can I write something like:

0 00 1 ? * ?

As from the examples listed in the documentation, it is only either  Day-of-month or Day-of-week is not specify but not both at the same time.

1 answer

1 accepted

3 votes
Answer accepted
Iago Docando
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.
June 23, 2021

https://crontab.guru

0 0 1 * * * Launches every day at 01:00 am regardless of the day of the week/month, if that's what you're trying to do.

Vandyck Lai Kai Yong
Contributor
June 23, 2021

This link is awesome.

Thank you and that is what I actually want to achieve but may I know why shouldn't I use "?" to place at the both attribute?

Iago Docando
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.
June 23, 2021

I'm not a CRON expert and I haven't even looked up what "?" means but I know "*" means "any" so there's no need to go further than that, I guess :)

Vandyck Lai Kai Yong
Contributor
June 24, 2021

Oh I see. Anyways, thank you @Iago Docando .

Like Iago Docando likes this

Suggest an answer

Log in or Sign up to answer