LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2011, 05:06 AM   #1
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 47

Rep: Reputation: 0
Easy logrotate question - remove rotated logs after 7 days


Hi there,

I have this set up to rotate apache log files everyday and then remove the rotated .gz logs after 7 days, but it is not removing them ...

/var/log/apache2/access_log /var/log/apache2/error_log /var/log/apache2/suexec.log /var/log/apache2/ssl_request_log /var/log/apache2/ssl_engine_log /var/log/apache2/*/*error_log /var/log/apache2/*/*access_log {
daily
compress
maxage 7
rotate 7
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

Is maxage and rotate the same ?

man page for logrotate maxage:
Remove rotated logs older than <count> days

man page for logrotate rotate:
Log files are rotated <count> times before being removed or mailed

Cheers
 
Old 08-17-2011, 07:58 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
You should only need 'daily' & 'rotate 7'. maxage is for if you don't care about num of logs, just how old they are.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logrotate for logs that change filenames badkuk Linux - Server 1 11-26-2010 03:57 AM
Logs are not rotated BroX Slackware 11 06-03-2009 07:49 PM
How Do zmd-messages Logs Get Rotated? ThisGuyIKnow SUSE / openSUSE 2 11-22-2006 12:49 PM
How to get logrotate to only rotate files 2 days old. yoda_mon Linux - Software 1 05-18-2006 09:55 PM
logrotate error - last rotated in the future ocgltd Fedora 1 10-02-2005 09:07 PM


All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration