Solved

Logrotate

Posted on 2004-09-27
5
307 Views
Last Modified: 2013-12-25
Hi,

I want to have logrotate name my rotated apache logs with today's date (e.g., access_log.092804.gz instead of access_log.1.gz).

I am sure some combination of things in /etc/logrotate.d/apache will do the trick, either pre-rotation or post-rotation, etc.  Can anyone help?

Thanks!

-Mike
0
Comment
Question by:mj9821
5 Comments
 
LVL 2

Author Comment

by:mj9821
Comment Utility
Here is my current logrotate settings:

/var/log/httpd/access_log {
    daily
    missingok
    rotate 31
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
    compress
}
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
Comment Utility
What you are searching is

      dateext
              Archive  old  versions of log files adding a daily extension like YYYYMMDD instead of
              simply adding a number.

option of logrotate
man logrotate

/var/log/httpd/access_log {
    daily
    dateext
    missingok
    rotate 31
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
    compress
}
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

771 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

16 Experts available now in Live!

Get 1:1 Help Now