1

I have the following, simple entry in crontab -e pertaining to an event that happens twice every month:

12 9 15,30 * * /home/run_ps.sh

For months with <30 days, I need to check on the first of the following month. Is there an elegant way to do this within crontab? I.e., more elegant than changing to 12 9 1,15,30 * * /home/run_ps.sh and checking the day of month within the script

3pitt
  • 899
  • 13
  • 21
  • check out the answers on [this question](https://stackoverflow.com/questions/6139189/cron-job-to-run-on-the-last-day-of-the-month) – mvrma Feb 15 '18 at 18:05

1 Answers1

1

As far as I am aware, there is only one month with less than 30 days and the following month is March.

Add the following additional job, which only runs on March 1st.

12 9 1 3 * /home/run_ps.sh
Cyrus
  • 84,225
  • 14
  • 89
  • 153