Date: Wed, 11 Feb 1998 09:59:59 +1100 (EST) From: "Daniel O'Callaghan" <danny@panda.hilink.com.au> To: Joao Carlos Mendes Luis <jonny@coppe.ufrj.br>, freebsd-hackers@FreeBSD.ORG Subject: Re: logrotate, a proposal Message-ID: <Pine.BSF.3.91.980211095602.294J-100000@panda.hilink.com.au> In-Reply-To: <Pine.BSF.3.91.980211083951.294I@panda.hilink.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 11 Feb 1998, I wrote: > On Tue, 10 Feb 1998, Joao Carlos Mendes Luis wrote: > > Worst, how would I know from the format how to "walk" through the old > > logs and select the older one to delete ? I cannot believe in the file > > date for this. > > In my bourne shell version, I say 'daily' 'weekly' 'monthly' and > calculate the number of days to keep the logs, based on find(1) and mtime. > In a perl version, it walks the directory looking for similarly named > files, and stat(2)s them, looking for files X seconds old, X being > calculated from the number of seconds in a day, and the number of days to > keep the files. The other possibility is to take expiretime = now - expiryseconds, and strftime(3) using expiretime to contruct the name of the file to delete. Try for both plain and .gz forms. Danny To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.980211095602.294J-100000>