Bug 57242

Summary: logrotate bug and enhancement request
Product: [Retired] Red Hat Linux Reporter: Christopher McCrory <chrismcc>
Component: logrotateAssignee: Elliot Lee <sopwith>
Status: CLOSED DEFERRED QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-12-07 18:41:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christopher McCrory 2001-12-07 18:41:43 UTC
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 19:58:27 UTC
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.