Hi,
I have an fc15 box and I'm having a problem with logwatch. I'm using bzip2 for the compresscmd for logrotate, yet it somehow is giving the compressed files a gz instead of bz2 extension. Logwatch uses this to determine which command to use to read the compressed files, so it therefore is using the wrong command.
However, the files seem to be begin rotated. I hoped someone could help clarify what's going on. I have the following in /etc/logrotate.conf:
# uncomment this if you want your log files compressed compresscmd /usr/bin/bzip2 compress
Here's a list of the freshclam files that are being compressed and rotated:
# ls -l /var/log/clamav/freshclam.log* -rw-rw---- 1 clamupdate amavis 6775 Oct 21 17:47 /var/log/clamav/freshclam.log -rw-rw---- 1 clamupdate amavis 939 Oct 11 23:47 /var/log/clamav/freshclam.log-20121012.gz -rw-rw---- 1 clamupdate amavis 916 Oct 12 23:46 /var/log/clamav/freshclam.log-20121013.gz -rw-rw---- 1 clamupdate amavis 855 Oct 13 23:46 /var/log/clamav/freshclam.log-20121014.gz
Running 'file' on the compressed files says they are bzip2 files. Here's the contents of the error message I receive from logwatch in an email every day from cron.daily:
/etc/cron.daily/0logwatch: gzip: /var/log/clamav/freshclam.log-20121019.gz: not in gzip format system 'zcat '/var/log/clamav/freshclam.log-20121019.gz' >> /var/cache/logwatch/logwatch.zOSnHbtE/clam-update-archive' failed: 256 at /etc/cron.daily/0logwatch line 764.
Why are the files being compressed and named with the wrong extension?
Thanks, Alex
Alex pise:
Hi,
I have an fc15 box and I'm having a problem with logwatch. I'm using bzip2 for the compresscmd for logrotate, yet it somehow is giving the compressed files a gz instead of bz2 extension. Logwatch uses this to determine which command to use to read the compressed files, so it therefore is using the wrong command.
However, the files seem to be begin rotated. I hoped someone could help clarify what's going on. I have the following in /etc/logrotate.conf:
# uncomment this if you want your log files compressed compresscmd /usr/bin/bzip2 compress
Here's a list of the freshclam files that are being compressed and rotated:
# ls -l /var/log/clamav/freshclam.log* -rw-rw---- 1 clamupdate amavis 6775 Oct 21 17:47 /var/log/clamav/freshclam.log -rw-rw---- 1 clamupdate amavis 939 Oct 11 23:47 /var/log/clamav/freshclam.log-20121012.gz -rw-rw---- 1 clamupdate amavis 916 Oct 12 23:46 /var/log/clamav/freshclam.log-20121013.gz -rw-rw---- 1 clamupdate amavis 855 Oct 13 23:46 /var/log/clamav/freshclam.log-20121014.gz
Running 'file' on the compressed files says they are bzip2 files. Here's the contents of the error message I receive from logwatch in an email every day from cron.daily:
/etc/cron.daily/0logwatch: gzip: /var/log/clamav/freshclam.log-20121019.gz: not in gzip format system 'zcat '/var/log/clamav/freshclam.log-20121019.gz' >> /var/cache/logwatch/logwatch.zOSnHbtE/clam-update-archive' failed: 256 at /etc/cron.daily/0logwatch line 764.
Why are the files being compressed and named with the wrong extension?
Is there another compress* option in you configuration? As of logrotate(8):
compressext Specifies which extension to use on compressed logfiles, if compression is enabled. The default follows that of the configured compression command.
the extension "should follow."
I have an fc15 box and I'm having a problem with logwatch. I'm using bzip2 for the compresscmd for logrotate, yet it somehow is giving the compressed files a gz instead of bz2 extension. Logwatch uses this to determine which command to use to read the compressed files, so it therefore is using the wrong command.
compressext Specifies which extension to use on compressed logfiles, if compression is enabled. The default follows that of the configured compression command.
the extension "should follow."
Ah, thanks. Never expected to have to do that.
The script should be written to use 'file' not just parse the extension.
Thanks, Alex
Am 24.10.2012 19:20, schrieb Joe Zeff:
On 10/24/2012 08:58 AM, Alex wrote:
The script should be written to use 'file' not just parse the extension.
Why? Just because in <.001% of the time the extension will be wrong? Not exactly an efficient use of resources.
because it is NOT the unix-way to rely on file-extensions these are meaningless all over the system
file-extensions are the windows-way
The script should be written to use 'file' not just parse the extension.
Why? Just because in <.001% of the time the extension will be wrong? Not exactly an efficient use of resources.
Are you in that much of a hurry to get your logwatch reports?
I'd prefer to have a more accurate program than knowingly produce an incomplete program just because it only affects a small number of people.
At the least, they should parse the compresscmd to see if it matches 'bzip2', which defaults to producing bz2 extensions.
Thanks, Alex