Limit size of log file from syslog | Unix Linux Forums | Linux

  Go Back    


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Limit size of log file from syslog

Linux


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-07-2007
jockey007 jockey007 is offline
Registered User
 
Join Date: Nov 2007
Last Activity: 6 August 2008, 8:36 PM EDT
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Limit size of log file from syslog

Hi,

I'm using Linux 2.6 cross compiled for a embedded powerpc.
Earlier we were using busybox syslogd for logging the messages, but as the flexibilty is less, we decided to move to standard syslog.

Now I want to limit the size of the log file (/var/log/messages) to 128K.
I couldn't find any option in syslog.conf file to limit file size of log file, at the same time this option is present in busybox syslog.

Due to flash's size limitation I can't use cron or logrotate.
So, any one please provide a work around to limit the size of /var/log/messages or to make this file a circular one?
Any help is appreciated.

Thanks
Jay
Sponsored Links
    #2  
Old 11-08-2007
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
 
Join Date: Nov 2006
Last Activity: 20 November 2013, 8:29 AM EST
Location: Bulgaria
Posts: 1,419
Thanks: 0
Thanked 6 Times in 6 Posts
use logrotate and its conf file, take a look here for examples.
Sponsored Links
    #3  
Old 11-09-2007
jockey007 jockey007 is offline
Registered User
 
Join Date: Nov 2007
Last Activity: 6 August 2008, 8:36 PM EDT
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks, but I've clearly mentioned that I can't use logrotate.
May be I am looking for some kind of work around

Last edited by jockey007; 11-09-2007 at 01:29 PM..
    #4  
Old 11-12-2007
jockey007 jockey007 is offline
Registered User
 
Join Date: Nov 2007
Last Activity: 6 August 2008, 8:36 PM EDT
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
hmm..
looks like there is no way to configure the log file size from syslogd
Sponsored Links
    #5  
Old 11-12-2007
idle idle is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 20 February 2008, 6:00 PM EST
Location: Wellington, New Zealand
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
no there's not. you need logrotate which is not a huge application (~40k). if you're so tight on space, you'll probably find that rewriting a bunch of commands in assembly language with only the functionality that you desire and linking to standard C calls will produce much much smaller binaries.

I've done this myself, and things like cat (which is about 10k) I rewrote in 42 bytes with basic error checking. rewrite a bunch of simple commands like that and you'll have room for logrotate (which you may not want to rewrite).
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Limit on a File size. rajeshorpu Shell Programming and Scripting 1 07-08-2010 03:42 PM
file size limit? JamesByars UNIX for Advanced & Expert Users 6 02-24-2010 01:39 AM
awk file size limit senior_ahmed Shell Programming and Scripting 4 03-30-2009 03:30 PM
Syslog Truncation / Size Limit? Puck UNIX for Advanced & Expert Users 1 03-16-2007 11:35 PM
Limit size of the file _hp_ UNIX for Dummies Questions & Answers 4 07-10-2002 01:44 PM



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