LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-08-2014, 07:39 AM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
logrotate is rotating all the rotations, how do I stop this?


logrotate is rotating all the rotations, how do I stop this?

Ex:
Code:
-rw-r--r--  1 root   root           0 Jun  1 03:43 error_log.1-20140501
-rw-r--r--  1 root   root           0 Jul  1 03:40 error_log.1-20140501-20140601
-rw-r--r--  1 root   root           0 Aug  1 03:51 error_log.1-20140501-20140601-20140701
-rw-r--r--  1 root   root           0 Sep  1 03:26 error_log.1-20140501-20140601-20140701-20140801
-rw-r--r--  1 root   root           0 Oct  1 03:26 error_log.1-20140501-20140601-20140701-20140801-20140901
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log.1-20140501-20140601-20140701-20140801-20140901-20141001
-rw-r--r--. 1 root   root   464323109 Mar 19  2014 error_log.1-20140501-20140601-20140701-20140801-20140901-20141001-20141101
-rw-r--r--  1 root   root           0 Jul  1 03:40 error_log-20140501-20140601
-rw-r--r--  1 root   root           0 Aug  1 03:51 error_log-20140501-20140601-20140701
-rw-r--r--  1 root   root           0 Sep  1 03:26 error_log-20140501-20140601-20140701-20140801
-rw-r--r--  1 root   root           0 Oct  1 03:26 error_log-20140501-20140601-20140701-20140801-20140901
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log-20140501-20140601-20140701-20140801-20140901-20141001
-rw-r--r--  1 root   root   318273638 May  1  2014 error_log-20140501-20140601-20140701-20140801-20140901-20141001-20141101
-rw-r--r--  1 root   root           0 Aug  1 03:51 error_log-20140613-20140701
-rw-r--r--  1 root   root           0 Sep  1 03:26 error_log-20140613-20140701-20140801
-rw-r--r--  1 root   root           0 Oct  1 03:26 error_log-20140613-20140701-20140801-20140901
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log-20140613-20140701-20140801-20140901-20141001
-rw-r--r--  1 root   root   110415272 Jun 13 03:26 error_log-20140613-20140701-20140801-20140901-20141001-20141101
-rw-r--r--  1 root   root           0 Sep  1 03:26 error_log-20140702-20140801
-rw-r--r--  1 root   root           0 Oct  1 03:26 error_log-20140702-20140801-20140901
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log-20140702-20140801-20140901-20141001
-rw-r--r--  1 root   root   111518473 Jul  2 03:42 error_log-20140702-20140801-20140901-20141001-20141101
-rw-r--r--  1 root   root           0 Sep  1 03:26 error_log-20140801
-rw-r--r--  1 root   root           0 Oct  1 03:26 error_log-20140801-20140901
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log-20140801-20140901-20141001
-rw-r--r--  1 root   root   183913438 Aug  1 03:51 error_log-20140801-20140901-20141001-20141101
-rw-r--r--  1 root   root           0 Oct  1 03:26 error_log-20140901
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log-20140901-20141001
-rw-r--r--  1 root   root   188078667 Sep  1 03:26 error_log-20140901-20141001-20141101
-rw-r--r--  1 root   root           0 Nov  1 03:44 error_log-20141001
-rw-r--r--  1 root   root   182754975 Oct  1 03:26 error_log-20141001-20141101
-rw-r--r--  1 root   root   200374140 Nov  1 03:44 error_log-20141101
 
Old 11-08-2014, 09:27 AM   #2
ember1205
Member
 
Registered: Oct 2014
Posts: 174

Rep: Reputation: 16
Post the contents of your /etc/logrotate.conf file.
 
Old 11-08-2014, 09:30 AM   #3
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
# system-specific logs may be also be configured here.
/etc/http/logs/*log /etc/http/domlogs/*.log {
missingok
daily
size 100M
maxage 60
postrotate
/usr/bin/killall -HUP httpd
endscript
}
 
Old 11-08-2014, 09:31 AM   #4
ember1205
Member
 
Registered: Oct 2014
Posts: 174

Rep: Reputation: 16
And where are the log files above located?
 
Old 11-08-2014, 09:47 AM   #5
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by ember1205 View Post
And where are the log files above located?
Those were in:
/etc/http/logs/
 
Old 11-08-2014, 09:54 AM   #6
ember1205
Member
 
Registered: Oct 2014
Posts: 174

Rep: Reputation: 16
Your http server is seemingly already using dates as part of the file name based on the very last file in your list (the name includes November 1 as part of the name and that is also the date on the file). I would suggest that you take a different tact with those files...

Create a section SPECIFICALLY for that directory and those files. As part of that section, shut down the daemon cleanly, rotate out the file, make a new one, and then start the daemon back up. Additionally, I would suggest that you compress the files to save space, or at least compress ones over a certain age. Based on most of the files having no size, I suspect that you are not actually rotating the files out at all.
 
Old 11-08-2014, 12:59 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
you also have a /etc/logrotate.d/apache2 file?
 
Old 11-08-2014, 01:06 PM   #8
ember1205
Member
 
Registered: Oct 2014
Posts: 174

Rep: Reputation: 16
Quote:
Originally Posted by Habitual View Post
you also have a /etc/logrotate.d/apache2 file?
It won't matter... The main config file doesn't reference including any additional files.
 
Old 11-08-2014, 02:32 PM   #9
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by Habitual View Post
you also have a /etc/logrotate.d/apache2 file?
I don't that only shows if you install the RPM I think. (I installed from tar)

Last edited by abefroman; 11-08-2014 at 02:40 PM.
 
Old 11-10-2014, 12:39 PM   #10
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,816
Blog Entries: 13

Rep: Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876Reputation: 4876
I'm thinking his part of the term is causing problems considering your file name structure:
Code:
/etc/http/logs/*log /etc/http/domlogs/*.log
Because it is not "STAR DOT log" it is "STAR log" which means files with log in the name.

Try adding an olddir term to your rotate.log. Make an /etc/httpd/rotated directory and then do something like this:
Code:
# system-specific logs may be also be configured here.
/etc/http/logs/*log /etc/http/domlogs/*.log {
missingok
olddir /etc/http/rotated
daily
size 100M
maxage 60
postrotate
/usr/bin/killall -HUP httpd
endscript
}
This will place your rotated files into the /etc/httpd/rotated directory.

If you also put in a "rotate #" term it will save that many backups, like "rotate 5" will append .1, .2, .3, .4, and .5 to files which get rotated. Note that 'rotate 0" will erase the file and start a new one.

Please also remember to place your code or comments within [code][/code] tags.
 
Old 11-10-2014, 12:43 PM   #11
ember1205
Member
 
Registered: Oct 2014
Posts: 174

Rep: Reputation: 16
I was thinking similar, but **log does not mean the same as *log* (which would truly mean having "log" in the name as opposed to at the end). And, it would need to be the latter definition in order to rotate those with log only in the name.

Alternatively, try changing **log to *.log
 
  


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
[SOLVED] Logrotate rotating logs when they should not (I think!) yzT! Linux - Server 1 09-26-2014 09:51 AM
[SOLVED] Logrotate Logs not rotating Ubunutu 12.4 LTS 116Fanatic Linux - Server 5 01-04-2013 01:51 PM
logrotate not rotating dman777 Linux - Software 3 08-23-2011 06:57 AM
logrotate not rotating files with date extension ajayan Linux - Newbie 1 10-25-2010 06:08 PM
Logrotate rotating daily when should rotate weekly nanda_martins Linux - Server 14 03-29-2010 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:22 AM.

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
Open Source Consulting | Domain Registration