Wednesday, January 11, 2012

How to clear a full partition

-->tail -5000 filename > filename.new 

mv filename.new filename sync 

This will copy the last 5000 lines from the file to a temporary file. 

Now you probably want to restart whatever service it is that created the file to release it's file lock on the file.

 /usr also fills up sometimes because of apache.  The first thing you should look at is usually the apache logs. 

cd to /usr/local/apache 

and type "du -sh *" and chances are you'll find that the logs/error_log or logs/access_log is very large. 

Feel free to delete them or use the tail trick above.

-----****-----****------****------****------

No comments:

Post a Comment