Sean Wells wrote:
What is the right way to clean apache2 logs?

Quoth david (on Monday, the 8th of August):
I use logrotate to loop through the logs daily...I generally only keep a
weeks worth or so due to size.  It'll automatically remove the old ones just
fine in the end.

Thanks looks like what I need, This is just my server here at the house
for my stuff, do I need to edit anything?
# packages can drop log rotation information into this directory
include /etc/logrotate.d

notifempty
nomail
noolddir

As always, the man page to logrotate provides helpful hints. Also, the default conf file.

interesting options in logrotate include
compress # gzips old logs
keep N  # keeps N <periods> of logs
where <periods> can be specified with daily|weekly|monthly

also, the "postrotate" option, which lets you specify an action/script to execute just after logs have been rotated, like e.g.:

postrotate
apache2ctl graceful
endscript


In Gentoo, the apache package drops a useful default file to /etc/logrotate.d/apache2

HINT: when playing with logrotate and the compress option, and using app-admin/sysklogd, be aware of the things in /etc/cron.daily/syslog.cron: most of the logfiles created by syslog will be rotated by this script, so don't include them in your logrotate setup!

Greets,
        Peter G.
--
"I do not think the way you think I think."
    -- Kai, last of the Brunnen G
--
[email protected] mailing list

Reply via email to