Find the answer to your Linux question:
Results 1 to 3 of 3

Thread: file size limit

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    file size limit

    I know there are some logs ( system or application log ) in the system , but I have some experience that sometimes these logs will growth to a unlimited size until the system is full ( maybe caused by system error ) , so that the system will be shutdown suddenly , is it possible to limit the log size ? or take some action such as gzip the file or inform system administrator when the file size over a certain of limit ? could provide suggestion ? thx.

  2. #2
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Look into logrotate you can get it gzip and move your logs. This is a good reason why you should put /var on its own partition for servers, then if the logs fill up all the space left then the rest of the system will still live

  3. #3
    thx reply ,

    I hv man the logrotate , it seems very good , but I am not too understand how to use it , I find the below example , I want to ask if I want to compress the /var/log/messages and mail to administrator when it reach 100M size , how to set it ? thx in advance.

    # sample logrotate configuration file

    /var/log/messages {
    rotate 5
    /sbin/killall -HUP syslogd

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts