LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-22-2010, 02:04 PM   #1
bkone
Member
 
Registered: Jun 2006
Distribution: SUSE, Red Hat, Oracle Linux, CentOS
Posts: 108

Rep: Reputation: 15
Novell SLES logrotate doesn't rotate all my specified logs


I am running Novell SLES 11 and have two virtual hosted sites running on this server with Apache. I am trying to get both sites to rotate their logs monthly so I then can take the monthly logs and throw them into a web analyzer to analyse the web traffic. Long story short I can't get the log files to rotate. Here is my /etc/logrotate.d/apache2 file:

/var/log/apache2/access_log {
compress
dateext
maxage 365
rotate 99
size=+4096k
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

/var/log/apache2/error_log {
compress
dateext
maxage 365
rotate 99
size=+1024k
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

/var/log/apache2/site-access_log {
compress
rotate 5
monthly
maxage 180
dateext
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

/var/log/apache2/site1-access_log {
compress
rotate 5
monthly
maxage 180
dateext
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

/var/log/apache2/suexec.log {
compress
dateext
maxage 365
rotate 99
size=+1024k
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

/var/log/apache2/ssl_request_log {
compress
dateext
maxage 365
rotate 99
size=+4096k
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

/var/log/apache2/ssl_engine_log {
compress
dateext
maxage 365
rotate 99
size=+1024k
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

The /var/log/apache2/access_log and /var/log/apache2/error_log appear to be rotating fine. But the ones I am in need of to work are the two /var/log/apache2/site-access_log and /var/log/apache2/site1-access_log. When I run logrotate -d -f /etc/logrotate.d/apache2 I get
reading config file /etc/logrotate.d/apache2
reading config info for /var/log/apache2/access_log
reading config info for /var/log/apache2/error_log
reading config info for /var/log/apache2/site-access_log
reading config info for /var/log/apache2/site1-access_log
reading config info for /var/log/apache2/suexec.log
reading config info for /var/log/apache2/ssl_request_log
reading config info for /var/log/apache2/ssl_engine_log

Handling 7 logs

rotating pattern: /var/log/apache2/access_log forced from command line (99 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/access_log
log needs rotating
rotating log /var/log/apache2/access_log, log->rotateCount is 99
dateext suffix '-20100622'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/apache2/access_log to /var/log/apache2/access_log-20100622
creating new /var/log/apache2/access_log mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/apache2/access_log : "
/etc/init.d/apache2 reload
"
compressing log with: /bin/gzip

rotating pattern: /var/log/apache2/error_log forced from command line (99 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/error_log
log needs rotating
rotating log /var/log/apache2/error_log, log->rotateCount is 99
dateext suffix '-20100622'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/apache2/error_log to /var/log/apache2/error_log-20100622
creating new /var/log/apache2/error_log mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/apache2/error_log : "
/etc/init.d/apache2 reload
"
compressing log with: /bin/gzip

rotating pattern: /var/log/apache2/site-access_log forced from command line (5 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/site-access_log
log needs rotating
rotating log /var/log/apache2/site-access_log, log->rotateCount is 5
dateext suffix '-20100622'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/apache2/site-access_log to /var/log/apache2/site-access_log-20100622
creating new /var/log/apache2/site-access_log mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/apache2/site-access_log : "
/etc/init.d/apache2 reload
"
compressing log with: /bin/gzip

rotating pattern: /var/log/apache2/site1-access_log forced from command line (5 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/site1-access_log
log needs rotating
rotating log /var/log/apache2/site1-access_log, log->rotateCount is 5
dateext suffix '-20100622'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/apache2/site1-access_log to /var/log/apache2/site1-access_log-20100622
creating new /var/log/apache2/site1-access_log mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/apache2/site1-access_log : "
/etc/init.d/apache2 reload
"
compressing log with: /bin/gzip

rotating pattern: /var/log/apache2/suexec.log forced from command line (99 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/suexec.log
log /var/log/apache2/suexec.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/apache2/ssl_request_log forced from command line (99 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/ssl_request_log
log /var/log/apache2/ssl_request_log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/apache2/ssl_engine_log forced from command line (99 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/ssl_engine_log
log /var/log/apache2/ssl_engine_log does not exist -- skipping
not running postrotate script, since no logs were rotated

It looks like site and site1 need rotating and a new compressed file should exist but it doesn't. I am not sure what the glob finding old rotated logs failed is all about either.

Any suggestions?
 
  


Reply



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 doesn't rotate logs kenneho Linux - Desktop 5 03-23-2010 12:13 PM
logrotate doesnt not rotate properly Niceman2005 Linux - Software 2 06-22-2009 04:26 AM
Logrotate: Rotate Apache logs, but never delete kenneho Linux - Newbie 2 10-23-2008 06:58 AM
'logrotate' does not rotate news logfile andrew.46 Slackware 2 01-28-2008 03:43 PM
How to get logrotate to only rotate files 2 days old. yoda_mon Linux - Software 1 05-18-2006 08:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:33 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