2

I need to set up a CRON job to be scheduled in

every 1st and the 3rd Monday of every Month.

I'm using the Plesk control panel for setting these as follows.

enter image description here

Currently CRON runs successfully, however on every Monday. Which isn't my requirement.

Also referred this link https://stackoverflow.com/questions/11683387/cron-run-every-2nd-and-4th-saturday-of-the-month Then the CRON runs on 1-7,15-21 fourteen times.

Anyone know a solution?

1 Answer 1

6

I recently scheduled the job, like you had/have. In similar case, what I do is find out the dates of month that usually fall on day of week, for example 1st Monday usually fall between 1-7 and 3rd Monday falls in between 15-23. Hence, following crontab should work for you

30 3 1-7,15-22 * * [`date +\%u` = 1] &&  <job>

above cronhjob gets schedule for each day between 1-7 and 15-23 dates of month, however, gets executed only when the day of week is 1 (Monday).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.