LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2014, 08:18 AM   #1
prabhakar1234
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Rep: Reputation: Disabled
Angry how to configure logrotate utility to limit the size of log file


Hello,

I'm looking for a way to limit the file size of some of our log files. For instance, /var/log/messages might grow to over a few hundred megs on some of our boxes used for testing. What I'd like to do would be to limit the size of the /var/log/messages file to something like 50MB, and when additional data comes in, new log file got created with same name and old one zipped with name like messages.1.gz


i used logrotate with following configuration file placed in /etc/logrotate.d/mylog

/var/log/mylog {
rotate 5
size 100k
daily
delaycompress
}

then restart rsyslog service and reload logrotate with logrotate -f mylog command .
but logsizes is going beyond specified (100k) limit

Anyone done something similar?

Thanks,
prabhakar
 
Old 07-07-2014, 08:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,253

Rep: Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419Reputation: 7419
see man logrotate, I think the postrotate part is missing
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache access log file recommended size limit kirukan Linux - Newbie 4 01-18-2011 10:12 PM
How to limit log file size with syslog-ng? AchimRS Linux - Software 2 01-05-2010 04:35 AM
log file size limit 2.1gb saurabh parli Linux - Software 6 06-18-2007 11:32 AM
Limit log file size Kevad Linux - General 6 09-28-2006 03:01 AM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:47 PM.

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