Apache logrotate question

Posted on 2012-09-17
Last Modified: 2012-10-09
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: 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: 20120826
     After compression:

Question by:icongo
    LVL 28

    Accepted Solution

    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.
    LVL 8

    Expert Comment

    Could you paste your logrotate.conf file ?
    LVL 8

    Expert Comment

    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.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now