Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Aug 2005 10:16:24 -0500
From:      Kevin Kinsey <kdk@daleco.biz>
To:        Nicolas Blais <nb_root@videotron.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: crontab : day-of-month support for last-day-of-month
Message-ID:  <43147848.4090606@daleco.biz>
In-Reply-To: <200508281316.48668.nb_root@videotron.ca>
References:  <200508281316.48668.nb_root@videotron.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
Nicolas Blais wrote:

>Hi,
>
>Does our crontab allow the use of "L" (as found on 
>http://wiki.opensymphony.com/display/QRTZ1/CronTriggers+Tutorial?decorator=printable) 
>in the day-of-month field which would allow for a job to run on a 31th or feb 
>28? 
>
>It would be useful for certain apps like /www/awstats to update their database 
>on the last hour of the month since putting the cron job on the 1st of the 
>month makes the software update in a new month and putting it on the 30th of 
>the month might loose 1 day.
>
>Nicolas.
>  
>

As Lowell noted, "last day" isn't an option currently.  Any number of
scripting languages, though, are capable of handling this.

Here was a solution we came up with, using PHP, a couple years
ago:

http://www.daleco.biz/articles/page.php?story=20

I'm sure something like this, or better, would be possible
with PERL, ruby, etc., or possibly even sh/bash, though I've
not tried.

HTH,

Kevin Kinsey



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43147848.4090606>