[Cialug] logrotation help for RHEL 6

Kelly Slaugh kelly at visionary.com
Tue Jan 27 13:44:21 CST 2015


Thanks Daniel,

The logs are well over 1 - 4 GB. I've been working on getting this setup for some time now.  I can't run the logrotate manually during the day due to traffic however I am going to run it manually tonight only because the size of the files.

I'm going to try and remove the daily and see if the size 512M will rotate the files tonight.  Thanks for suggestion.

Kelly L. Slaugh // Systems Administrator
Visionary Services, Inc.
P1: 515.369.3545 ext. 116
P2: 888.303.2848 ext. 116
f: 515.369.3546
visionary.com

-----Original Message-----
From: Daniel A. Ramaley [mailto:daniel.ramaley at drake.edu] 
Sent: Tuesday, January 27, 2015 1:25 PM
To: cialug at cialug.org
Cc: Kelly Slaugh
Subject: Re: [Cialug] logrotation help for RHEL 6

I've never set up log rotation specifying both a period ("daily") and a size ("size 512M"). Normally one specifies either a period (such as
daily) or a maximum size, but not both.

>From the logrotate.conf(8) on an RHEL6 box: "Log files are rotated only if they grow bigger then size bytes." So i think if you specify a size that the logs won't rotate until they grow large enough.

On 2015-01-27 at 15:51:24 Kelly Slaugh wrote:
> Hello Everyone,
> 
> I've been working on troubleshooting why a particular config file will 
> not rotate daily as I've set the config file to do.  Here is my config 
> file details minus actual path.
> 
> /path/to/directory/logs/*log {
>         daily
>         missingok
>         rotate 32
>         notifempty
>         size 512M
>         compress
>         delaycompress
>         create 644 apache apache
>         sharedscripts
>         postrotate
>                 /sbin/service httpd reload > /dev/null 2>/dev/null || 
> true /sbin/service nginx reload > /dev/null 2>/dev/null || true 
> endscript }
> 
> I'm having to reload nginx as well has apache because the logs that 
> are stored are apache and nginx logs.  And as we know apache and nginx 
> will not start using the logs unless they are reloaded.  The config 
> file is stored in the /etc/logrotate.d/ directory.  Everything works 
> on the weekly rotation set up in the /etc/logrotate.conf file.
> However, from my research and knowledge isn't logrotate supposed to 
> rotate the files based off the config file settings?
> 
> Any help or ideas would be greatly appreciated.
> 
> Thank you
> 
> Kelly S.
> 
> 
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
__
Daniel A. Ramaley  |  Network Engineer 2 Drake Technology Services (DTS) | Drake University

T: +1 515 271-4540
F: +1 515 271-1938
E: daniel.ramaley at drake.edu



More information about the Cialug mailing list