I am wondering if this is even possible. I would like my job to start running daily on the 5th business day until the end of the month, every month.
ex Aug - 7-31 Sep - 7-30 Oct - 4-31
Is this even possible?
Thanks in advance
I am wondering if this is even possible. I would like my job to start running daily on the 5th business day until the end of the month, every month.
ex Aug - 7-31 Sep - 7-30 Oct - 4-31
Is this even possible?
Thanks in advance
You can use this in your cron tab
* 10 5-31 * * [ "$(date '+\%a')" == "Mon" ] && command to execute
* 10 5-31 * * [ "$(date '+\%a')" == "Tue" ] && command to execute
* 10 5-31 * * [ "$(date '+\%a')" == "Wed" ] && command to execute
* 10 5-31 * * [ "$(date '+\%a')" == "Thu" ] && command to execute
* 10 5-31 * * [ "$(date '+\%a')" == "Fri" ] && command to execute
This will run everyday from 5th of every month till the end of the month at 10 A.M. If it is a weekday. This takes care of the weekdays and not the business calendar.
If you need it to be according to your business calendar you will have to write single a cron for each day it is to be run.
Ref: https://www.switchplane.com/blog/how-to-run-a-cron-job-on-the-first-weekday-of-the-month/