Handy Hints: Emptying log files

When emptying log files, don’t just rm log_file.log as the disk space won’t be freed until the application that is logging is restarted.

It is better to use > log_file.log as that will allow the file system to free the space that is used by the open file.

About Anthony Batchelor

Job: Software engineer at Mercurytide Hobbies: Guitar/Band, Kendo, Beer Brewing, Simple Electronics, Python hacking.
This entry was posted in How-to, sys-admin and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>