The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Limit the size of a directory agasamapetilon UNIX for Dummies Questions & Answers 3 08-25-2008 07:15 AM
Limit directory size jredx Linux 2 05-27-2008 04:25 AM
how to set size in logrotate.conf icehero UNIX for Dummies Questions & Answers 0 02-24-2008 04:41 AM
Limit Folder Size tisdmin UNIX for Dummies Questions & Answers 2 01-17-2007 11:00 PM
file size limit vjm AIX 2 09-27-2005 10:46 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-30-2008
modcan modcan is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
logrotate size limit

Hi
i configured log rotate for a specific file.
/var/log/sauer

i configured create a file in logrotate.d
[root@ci logrotate.d]# cat /etc/logrotate.d/sauer
#this is a logrotate configuration file for msu_ng logs

/var/log/sauer {
rotate 5
size=1M
daily
compress
postrotate
/usr/bin/killall -HUP syslogd
endscript
}

then i update the file by using l"ogrotate -f /etc/logrotate.d/sauer"
then i test the new log with IO(while true ; do echo "blabla" >> /var/log/sauer ;done)
i dont understand why the log size is getting larger then 1MB (as you can see i configured size=1M)? do you know why the size limit didnt effect.
  #2 (permalink)  
Old 10-30-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
The limit is only checked after the next invocation of logrotate. So, make it bigger than 1 MB, THEN run logrotate. Also, remove the = sign. This might prevent the script from properly seeing the "size" option.
  #3 (permalink)  
Old 10-30-2008
modcan modcan is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
so is there any way to limit the exact log size ?
  #4 (permalink)  
Old 10-30-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
Well, you can run logrotate with high granularity -- every minute using a cron job. Or, you can pipe the output of your process to [i]rotatelogs[i], a program that comes with apache:
Code:
 some_process 2>&1 | /usr/sbin/rotatelogs /var/log/sauer 1M
  #5 (permalink)  
Old 10-30-2008
modcan modcan is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
thanks
one last thing
do you know what is the option that related to the first rotation.
mean if there is compress it wont effect the first rotate log(like messages.1).
cheers
  #6 (permalink)  
Old 10-30-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
delaycompress
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0