[CentOS] run script on cron job only run on first Saturdat every month???

m.roth at 5-cent.us m.roth at 5-cent.us
Tue Jul 30 21:05:10 UTC 2013


John R Pierce wrote:
> On 7/30/2013 1:43 PM, mcclnx mcc wrote:
>> we have CENTOS 5.5 on DELL server.  One of our script need run on first
>> Saturday every month.
>>
>>   We have following setup on cron job but it run every Saturday.
>>
>> 15 04 1-7 * 6 /home/app/oracle/backup/monthlybk.sh
>>
>>    Any one know how to fix it?
>
> I don't believe cron has any concept of the first day-of-week of each
> month, so you'll need to put some code into your script to exit if its
> NOT the first day-of-week of each month.

It certainly doesn't. However, I'm surprised the o/p's crontab entry
*doesn't* work: it should run only on Sat, and only on when it's somewhere
between the 1st and the 7th, which could only be the first Sat.

     mark




More information about the CentOS mailing list