Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I know it clears out /tmp on reboots, but I haven't been able to find any sort of cron job on my server that clears /tmp. I recently set up a script that writes lots of files to /tmp and my server usually goes several months between reboots so I'm concerned about it being cluttered.

I've seen several other distros that have a tmpwatch script installed by default. Ubuntu's repository seems to have replaced tmpwatch with tmpreaper.

Is there any mechanism in place on Ubuntu (8.04 currently, soon to be upgraded to 10.04 when I get around to it) to clean up temp files on a server that doesn't regularly reboot or do I need to install tmpreaper?

share|improve this question
5  
Shouldn't your update/fix/file-a-bug for the script so that it cleans up its temp files when it is done with them? It is very poor design for a program to write temp files and not have a facility to clean up after itself. –  Zoredache May 20 '10 at 18:49
    
What Zoredache said -- Scripts (& users) should clean up after themselves. tmpwatch/tmpreaper/whatever is a brute force fix for ill-behaved code (that being said, I run a tmp-cleaner myself - I have a bad habit of leaving junk in /tmp :) –  voretaq7 May 20 '10 at 19:01
add comment

1 Answer

up vote 5 down vote accepted

You will need to install tmpreaper.

share|improve this answer
5  
...or fix the script to clean up its own mess :-) –  voretaq7 May 20 '10 at 19:05
add comment

Your Answer

 
discard

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.