From owner-freebsd-questions@FreeBSD.ORG Tue Aug 30 15:17:47 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9078816A46F for ; Tue, 30 Aug 2005 15:17:47 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB8BD43D49 for ; Tue, 30 Aug 2005 15:17:45 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [192.168.2.2] ([69.27.149.254]) by ezekiel.daleco.biz (8.13.1/8.13.1) with ESMTP id j7UFGYok094661; Tue, 30 Aug 2005 10:16:55 -0500 (CDT) (envelope-from kdk@daleco.biz) Message-ID: <43147848.4090606@daleco.biz> Date: Tue, 30 Aug 2005 10:16:24 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.10) Gecko/20050823 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nicolas Blais References: <200508281316.48668.nb_root@videotron.ca> In-Reply-To: <200508281316.48668.nb_root@videotron.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: crontab : day-of-month support for last-day-of-month X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2005 15:17:47 -0000 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