Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.99 sec)
Logrotate rotation on size and not numbers of days or weeks

Can Logrotate only rotate logs if they're say 1MB in size and not weekly ?

I'm scratching my head at this one. Thanks.
Asked by:
HarryP
1344 points
 Report Abuse
 Share Page - Category: Linux Servers - Tags: Logrotate rotation on size and not numbers of days or weeks
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (2)

Best Answer

Use size instead of daily/weekly etc

"/var/log/httpd/access.log" /var/log/httpd/error.log {

rotate 5

mail www@my.org

size 100k

sharedscripts

postrotate

/sbin/killall -HUP httpd

endscript

Response by:
apjone
1478 points
Excellent, I couldn't see the woods for the trees ! Thanks.

Response by:
HarryP
1344 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2013 Server Circle