Limit size of log file from syslog


 
Thread Tools Search this Thread
Operating Systems Linux Limit size of log file from syslog
# 1  
Old 11-07-2007
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
# 2  
Old 11-08-2007
use logrotate and its conf file, take a look here for examples.
# 3  
Old 11-09-2007
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 02:29 PM..
# 4  
Old 11-12-2007
hmm..
looks like there is no way to configure the log file size from syslogd
# 5  
Old 11-12-2007
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).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Autosys R11.3 : Error on log file size limit

Just had a migration from Autosys 4.5 to R11.3. After the migration to R11.3, Autosys jobs have been failing when the log file reaches a size of 800 MB. This did not happen before the migration, when Autosys 4.5 was used. Is there a way to configure the file size limit/cap in Autosys... (1 Reply)
Discussion started by: kimo222
1 Replies

2. Shell Programming and Scripting

Limit on a File size.

Hi All, I want to store 32KB of file in Oracle DB into CLOB field. I am not able to insert more than 32KB of file into CLOB. So i want to put a limit on the file size. I am using k shell. My file size will dynamically increase its size, i want to check the file size if it is more than 32KB... (1 Reply)
Discussion started by: rajeshorpu
1 Replies

3. Shell Programming and Scripting

Log Size Exceeds Limit

Everytime I try to start Discreet Flame on my Octane2 machine it keeps giving me an error message "initial log size exceeds limit--aborting" Can anyone please help me how to fix this problem. Thanks. Octane2 IRIX64 Release 6.5 Flame 2007 (6 Replies)
Discussion started by: dewaraja
6 Replies

4. UNIX for Advanced & Expert Users

Log Size Exceeds Limit

Everytime I try to start Discreet Flame on my Octane2 machine it keeps giving me an error message "initial log size exceeds limit--aborting" Can anyone please help me how to fix this problem. Thanks. Octane2 IRIX64 Release 6.5 Flame 2007 (0 Replies)
Discussion started by: dewaraja
0 Replies

5. UNIX for Dummies Questions & Answers

Log Size Exceeds Limit

Everytime I try to start Discreet Flame on my Octane2 machine it keeps giving me an error message "initial log size exceeds limit--aborting" Can anyone please help me how to fix this problem. Thanks. Octane2 IRIX64 Release 6.5 Flame 2007 (0 Replies)
Discussion started by: dewaraja
0 Replies

6. UNIX for Advanced & Expert Users

Syslog Truncation / Size Limit?

I searched and could not find an answer to this, and am having difficulty, so I would appreciate any assistance that can be offered. We're experiencing logs that are having all characters after the 850th one written being truncated. I am wondering if there is a default limit to the syslog... (1 Reply)
Discussion started by: Puck
1 Replies

7. UNIX for Advanced & Expert Users

File Size Limit

Hi, I have a problem writing or copying a file 2GB or larger to either the second or third disk on my C8000. I've searched this forum and found some good information on this but still nothing to solve the problem. I'm running hpux 11i, JFS3.3 and disk version 4 (from fstyp) on all 3 disks. ... (2 Replies)
Discussion started by: HaidoodFaulkauf
2 Replies

8. AIX

file size limit

Can anybody help me? How to increase file size limit in aix 5.2? I have already specified in /etc/security/limits file : default: fsize = -1 core = 2097151 cpu = -1 data = -1 rss = -1 stack = -1 nofiles = 2000 (2 Replies)
Discussion started by: vjm
2 Replies

9. Solaris

File size limit

I want to have a permanent file created - and limit the size that this file can grow.. I want a circular file.. ie max size of file is 10 mb.. and if any new data written to file the oldest data removed.. How can I do this? I am on solaris 9 x86 (3 Replies)
Discussion started by: frustrated1
3 Replies

10. UNIX for Dummies Questions & Answers

Limit size of the file

How do I limit size of a file to 1 MB or something like that under Linux? (4 Replies)
Discussion started by: _hp_
4 Replies
Login or Register to Ask a Question