Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need help of cron

I need cron expression for below

one time per quarter. first week of month(working days)

1 answer

0 votes
Dirk Ronsmans Community Leader Jan 10, 2022

Hey @DINESH ,

You can use the below site to create a CRON expression.

https://www.freeformatter.com/cron-expression-generator-quartz.html

This one allows you to click/select what you need and it will provide you with the correct CRON expression.

Hi Ronsmans

I tried multiple ways to find in cron tab but no luck I need exact cron expression  for my rewuirement

Dirk Ronsmans Community Leader Jan 10, 2022

You could try with thisone:

0 0 0 1W 1/3 ? *

That means

At 00:00:00am, on the nearest weekday to the 1st of the month, every 3 months starting in January

As there isn't a "Quarterly" one you can do "every 3 months starting in january.

Nearest weekday ot the 1st of the month also seems good for me.

For example this would trigger on:

  • Fri Apr 01 00:00:00 UTC 2022
  • Fri Jul 01 00:00:00 UTC 2022
  • Mon Oct 03 00:00:00 UTC 2022
  • Mon Jan 02 00:00:00 UTC 2023
  • Mon Apr 03 00:00:00 UTC 2023
  • Mon Jul 03 00:00:00 UTC 2023
  • Mon Oct 02 00:00:00 UTC 2023
  • Mon Jan 01 00:00:00 UTC 2024
  • Mon Apr 01 00:00:00 UTC 2024
  • Mon Jul 01 00:00:00 UTC 2024

Hi Ronsmans I tried this also as per this results is 1st of the month but i want 1st week working days and i am strucking here 

Dirk Ronsmans Community Leader Jan 10, 2022

Well no it's not the first of the month.

This expression will give you the first weekday closest to the first day of the month.

Do you need all working days for the first week?

You might need to split it up then for each day:

0 0 0 ? JAN,APR,JUL,OCT 2#1 * 

At 00:00:00am, on the 1st Monday of the month, in January, April, July and October

 

0 0 0 ? JAN,APR,JUL,OCT 3#1 *

At 00:00:00am, on the 1st Tuesday of the month, in January, April, July and October

 

0 0 0 ? JAN,APR,JUL,OCT 4#1 *

At 00:00:00am, on the 1st Wednesday of the month, in January, April, July and October

 

0 0 0 ? JAN,APR,JUL,OCT 5#1 *

At 00:00:00am, on the 1st Thursday of the month, in January, April, July and October

 

0 0 0 ? JAN,APR,JUL,OCT 6#1 *

At 00:00:00am, on the 1st Friday of the month, in January, April, July and October

 

Not sure if you can combine it in to a single one if it has to be only the first week.

I need cron expression for all working days in the first week. I tried above expression but my client never accepted that, they want exact expression 

Dirk Ronsmans Community Leader Jan 10, 2022

Then I fear that I can't help you further, these are working expressions but you need to split it up for each weekday.

Ok Ronsmans,

 

Anyways thank you very much for reply

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

753 views 23 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you