Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    ust
    ust is offline
    Just Joined!
    Join Date
    Feb 2005
    Posts
    77

    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
    Location
    England
    Posts
    1,219
    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
    ust
    ust is offline
    Just Joined!
    Join Date
    Feb 2005
    Posts
    77
    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
    compress

    /var/log/messages {
    rotate 5
    weekly
    postrotate
    /sbin/killall -HUP syslogd
    endscript
    }

  4. $spacer_open
    $spacer_close

Posting Permissions

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