Technical Helpweb

Dialogic® PowerMedia™ Extended Media Server (PowerMedia XMS) - more articles

How to limit the size of your syslog files

Introduction:

The default syslog configuration on certain Red Hat Enterprise Linux and CentOS systems may rotate the syslog file every week, regardless of the size of the syslog file.

On systems with limited hard disk space, especially those were there is a size limited partition used for the /var subtree, this can be problematic if the syslog file size exceeds what is typically expected, for example, in the case of a large number of firmware errors in a Dialogic® PowerMedia™ Host Media Processing Software Release 4.1LIN installation.

The procedure outlined below can be used to limit the size of the syslog message file and check the size of the file every hour. There are other ways to achieve the same result, for example, using rsyslog config and imux rsyslog config, but these require more work than the procedure below.


Procedure:

Move logrotate from the daily cron job to hourly cron job:

mv /etc/cron.daily/logrotate /etc/cron.hourly

Edit /etc/logrotate.d/syslog, and add the lines outlined in bold below. The example below uses a file size of 10kb, but you can set this to whatever you want.

/var/log/cron /var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{

  nodateext
  size 10k

  sharedscripts
  postrotate
   /bin/kill -HUP 'cat /var/run/syslogd.pid 2> /dev/null' 2> /dev/null || true
  endscript
}

Product List:

Dialogic® PowerMedia™ Host Media Processing Software Release 4.1LIN
Dialogic® PowerMedia™ Extended Media Server (XMS)


Related Documentation:  

Note that Dialogic is not responsible for the content on the third-party website listed below
logrotate usage




Feedback

Please rate the usefulness of this page:  
0 - not useful at all
1 - potentially useful
2 - quite useful
3 - very useful
4 - exactly the information I needed     

Please enter a comment about this page:

First published: 24-Jan-2014
Open access: Product rule: open; Page rule: Auto