Re: Fwd: suggestion to handle stock Fedora 8 logrotate changed extension on archived log files
Mike Tremaine <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
MrC wrote: >> ---------- Forwarded message ---------- >> From: Damon Hart >> Date: Mon, Feb 11, 2008 at 5:44 AM >> Subject: suggestion to handle stock Fedora 8 logrotate changed >> extension on archived log files >> To: [email protected] >> >> >> Following up on some items I found missing in my logwatch daily recap >> email, I see that events occurring prior to log rotation were not >> reflected in logwatch. Comparing different machines, it looks like this >> problem occurs (in my case) only on Fedora 8 (vs earlier Fedora >> revisions.) Further poking around suggests that the problem arises >> because of the stock Fedora 8 logrotate convention for naming archived >> log files. These filenames are now: >> >> messages.20080210 >> messages.20080203 >> messages.20080127 >> messages.20080120 >> >> instead of the prior convention: >> >> messages.1 >> messages.2 >> messages.3 >> messages.4 >> On my fedora 8 is is - not . > [mgt@dwarfstar ~]$ ls -al /var/log/messages* > -rw------- 1 root root 212 2008-04-30 08:30 /var/log/messages > -rw------- 1 root root 574792 2008-04-07 08:39 /var/log/messages-20080407 > -rw------- 1 root root 338783 2008-04-14 07:47 /var/log/messages-20080414 > -rw------- 1 root root 623934 2008-04-21 08:20 /var/log/messages-20080421 > -rw------- 1 root root 804230 2008-04-30 07:02 /var/log/messages-20080430 > > @TempLogFileList = sort{ > ($b =~ /\.(\d+)$/)[0] <=> ($a =~ /\.(\d+)$/)[0] > || > uc($a) cmp uc($b) > }(glob($dir . $ReadConfigValues[$i])); > > Why, oh why did they do this :) If we remove the dot and just to a numeric compare on any numbers it would work. But what about the system that gzip the archive? so we'd have something like messages-20080407.gz or cron.1.gz -Mike