crontab 4th Tuesday of month

Frank Murphy frankly3d at gmail.com
Sat Jul 28 13:10:44 UTC 2012


On 28/07/12 13:50, Jorge Fábregas wrote:
> On 07/28/2012 07:03 AM, Frank Murphy wrote:
>> I thought the last tuesday would be covered by above.
>> But it has run everyday since 22nd.
>
> Hi,
>
> There's no way to accomplish this via crontab itself.  You'll need a
> little help by means of a script.
>
> This works:
>
> 1)  create the following script. Let's call it tuesday-check.sh:
>
> #/bin/sh
> [ `date +%m` -ne `date -d "+7 days" +%m` ] && your-actual-command.sh
>


Will check this for next Tuesday.
Thank everybody for the replies.


-- 
Regards,
Frank
"Jack of all, fubars"


More information about the users mailing list