Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have noticed that "logs" and "tmp" content take 36GB and 21GB respectively. I need to free up some disk space and currently wondering is it vise to clean them.


share|improve this question
up vote 3 down vote accepted

Delete logs older than 7 days.

find tomcat/logs/ -mtime +7 -print0 | xargs -r -0 rm -rf

You probably want to add this as a cronjob too.

Before deleting temp-files, you should make sure that nothing is holding them open.

share|improve this answer

You should set up tomcat in logrotate properly. Something like this as /etc/logrotate.d/tomcat:

/var/log/tomcat/*.log /var/log/tomcat/*.out {  
 rotate 7  

tmp you might want to sweep using the find command that pkhamre showed, but I would use logrotate on the log files. You didn't say which distro you're using, but RHEL/CentOS has tmpwatch, which will remove files that haven't been accessed for a defined period of time.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.