• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

Apache logrotate question

Good day,

I am using logrotate to rotate apache logs.  Problems is that I am using the dateext option in logrotate.conf which adds the date after the log file.

I am also  using a custom name for the logfiles for example, access logs I am using:new.client.com_access.log

Once the logs are rotated, the file get  renamed to: new.client.com-20120826 which is fine.

Now the problem I am facing is that my  logrotate configuration file in logrotate.d does not sees the timestamps. it looks for .log only:
/var/log/httpd/*log {..}

Is there a way to tell logrotate to  compress  the logs that ends  with a  date?

EX: Before logrotate:
new.client.com- 20120826
     After compression:
new.client.com-20120826.gz

Thanks.
0
icongo
Asked:
icongo
  • 2
1 Solution
 
Jan SpringerCommented:
I would recommend uncommenting "compress" in /etc/logrotate.conf and compress all of them.

You can always use 'zcat' to uncompress the file on the file without writing the uncompressed data to disk.
0
 
morsunCommented:
Could you paste your logrotate.conf file ?
0
 
morsunCommented:
Some people were having problems with dash so that you can add dateformat .%Y%m%d and maybe delaycompress will be usefull.  Option -d will let you test this.
0
 
icongoAuthor Commented:
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now