Date: Sat, 6 Dec 2003 11:37:39 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: michael <michael@nettmail.de> Cc: freebsd-stable@freebsd.org Subject: Re: newsyslogwithdate-extension-logfiles Message-ID: <20031206113739.GA20462@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <20031206101611.GA21554@brenner.msresearch.org> References: <20031206101611.GA21554@brenner.msresearch.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 06, 2003 at 11:16:12AM +0100, michael wrote: > i widely use FreeBSD and his enhancement's vs. other OS'es. >=20 > Now i have the wish that the 'newsyslog' uses date-extensions > in the 'rotated' logfiles. > eg: >=20 > messages.0.gz should be messages.20031206.gz and so on... >=20 > or any other extension that will give the date in the name of file? >=20 > is this possible with the newsyslog? > I think no! And why? Hmmm... newsyslog(8) has no intrinsic capability to label the backup files it creates with the date. It would be quite easy to write a script that went round after newsyslog and renamed any backup log files according to their last modification date, but that would mean that newsyslog won't recognise the backup of the logfile when it comes time to reclaim space in the partition. You could insert the date into the file path by modifying /etc/crontab: 0 * * * * root d=3D/var/log/`date +%Y%m%d`; [ -d $d ] || mkdir $d ; newsysl= og -a $d but that still suffers from the problem of newsyslog(8) not being able to remove the oldest backup files. Also, take a look at the sysutils/cronolog port -- I don't think it will help you very much with log files generated by syslogd(8) but it works very well with apache and similar. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/0b+DdtESqEQa7a0RAmfZAKCKZPwaFGrozegMgd9aECpor882qwCfRWf2 fJd7N7Qyt06iBKfdqpf2IRQ= =XJ0u -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031206113739.GA20462>