Solved newsyslog delayed compression

Hello everyone,

How can I achieved delayed compression like the one existing in logrotate, here is my config (I did not find this in the man) :

Code:
/var/log/apache24/httpd-access.log  644  52  *  @T04 J  /var/run/httpd.pid 30

I wish to delay the compression by one day :

- Current log.
- Rotated log.
- Compressed log.

Thanks
 
As far as I know newsyslog(8) doesn't have that feature. Alternatively, if you have ZFS, you could enable compression on the filesystem, then you wouldn't need to compress the files individually.
 
You could compress the .2 file by hand. Take out the J flag from the entry in question (J to -) and change the command in /etc/crontab to newsyslog; /full/path/to/bzip2 /var/log/apache24/httpd-access.log.2.

Untested etc,
Juha

newsyslog(8) does accept .bz2 nicely, even if it did not compress the file himself. Herself.
 
Thanks for the answers, I guess I'll have to stick with logrotate to achieve it natively, too bad newsyslog does not have this feature.
 
Learn to use bzless and bzcat (both can read compressed and uncompressed files)? That's what I use.
 
Thanks for all your answers, I finally used newsyslog on kannel with its default compression method, but it will be great if there is a delayed compression like in logrotate.
 
Back
Top