Bug 57242 - logrotate bug and enhancement request
logrotate bug and enhancement request
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
7.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-07 13:41 EST by Christopher McCrory
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-12-07 13:41:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christopher McCrory 2001-12-07 13:41:43 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Description of problem:
when having both "daily" and "size=XXX" only the last entry is used.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.  edit a logrotate conf file
2.  add both "daily" (or weekly, etc) and 'size=XXX'
3.
	

Actual Results:  only the last entry is used
with:
daily
size=XXX
only the size option is used

with:
size=XXX
daily

only the daily option is used



Expected Results:  the logs should be rotated if either condition is met


Additional info:

/var/log/access_log /www/logs/agent_log /www/logs/error_log
/www/logs/referer_log {
    rotate 8
    missingok
    compress
    delaycompress
    daily
    size=1024M
    noolddir
    sharedscripts
    postrotate
      /bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
}


this should rotate the web logs if the logs get too big (accesslog) OR
daily (errorlog) ( if logrotate is run hourly)




it would also be nice if size could handle 'G' in addition to 'k' and 'M'


it would also be nice if some of the options could be passed via the
command line.

/usr/sbin/logrotate "size=1G" /etc/logrotate.d/apache



it would also be nice if the extensions could be in UNIX epoch format

option: useepoch

so you would get:
/var/log/maillog
/var/log/maillog.1007683200
/var/log/maillog.1007596800.gz


another useful option would be

extension  HOSTNAME

so you would get
/var/log/maillog
/var/log/maillog.foo.1
/var/log/maillog.foo.2.gz

the last two combined would be very useful where logs are archived and
collected on a central server

/logs/archive/...
  maillog.serv1.1007683200.gz
  maillog.servn.1007683200.gz
...
  messages.serv1.1007683200.gz
... etc.


but whis IS NICE is the whole program.  It does work well and reliably.
Comment 1 Elliot Lee 2002-01-29 14:58:27 EST
Hi,

See bug #52525 for a response to the rotation criteria issue.

I've added a 'G' specifier for size into CVS (will be 3.6.2).

For the rest of the suggestions, about all I can promise is to accept a patch :)

Thanks.

Note You need to log in before you can comment on or make changes to this bug.