Matthew Seaman m.seaman at
Sat Dec 6 03:37:52 PST 2003

On Sat, Dec 06, 2003 at 11:16:12AM +0100, michael wrote:

> i widely use FreeBSD and his enhancement's vs. other OS'es.
> Now i have the wish that the 'newsyslog' uses date-extensions
> in the 'rotated' logfiles.
> eg:
> messages.0.gz should be messages.20031206.gz and so on...
> or any other extension that will give the date in the name of file?
> 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=/var/log/`date +%Y%m%d`; [ -d $d ] || mkdir $d ; newsyslog -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.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP:         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-stable mailing list