Nothing stupid about them...

...I just stole the name from David Letterman's "stupid pet tricks". I hope these tips help you avoid or fix mistakes along the way in your *nix administration duties.

Tuesday, December 20, 2011

A log file is filling up my file system!

Application log files that grow uncontrollably can cause problems, like filling up whatever file system they're located on.

The best way to handle this is to stop the application so you can remove the offending logs, or compress them, then restart the application. But in a production environment you may not be able to stop the application whenever you want.

So, desperate times call for desperate measures. Whack that log file without affecting the application's ability to write to it.


cat /dev/null > /var/app/logfile


...and the app will keep on ticking while you breathe a sigh of relief and set up logrotate!

No comments:

Search

Google