I want to run a script that generates a weekly report every Saturday night at 11 PM, and another script that generates a monthly report on the 1st of each month.
I don't want the weekly report to run if Saturday falls within 3 days of the 1st of the month.
here is once a month:
0 23 1 * * /home/me/monthly.sh
here is as close to the weekly entry as I can figure out...
0 23 4-? * 6 /home/me/weekly.sh
Can I replace that question mark with something that means "3 days before the end of the month"? Or is there some other approach that would suit my purpose?
Being able to specify some number of days before the end of the month seems like a feature you'd want to have in a job scheduler, so I'll be a bit surprised if crontab can't do it.
My alternative would be to check the date in weekly.sh, and stop if I'm within 3 days of the 1st.