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.
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 :)
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
/sbin/killall -HUP syslogd