Re: run script on cron job only run on first Saturdat every month???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 07/30/2013 04:58 PM, John R Pierce wrote:
> On 7/30/2013 2:32 PM, Keith Keller wrote:
>> 15 04 1-7 * 6 /home/app/oracle/backup/monthlybk.sh
>
> maybe...
>
> 	15 04 * * 6 test $(date +"%d") -le 07 && /home/app/oracle/backup/monthlybk.sh
>
> (untested)

Definitely untested!  You need to escape the "%" sign, since it is special
to cron.  Plus, you need to prevent the date command from padding its
output with a leading zero, since that would result in the illegal octal
numbers 08 and 09:

   15 04 * * 6 test $(date +"\%_d") -le 7 && /home/app/oracle/backup/monthlybk.sh

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux