Reputation: 345
Hi with a (bad) script of mine I filled up lots of files in /tmp folder. Now when I do ls in tmp folder it doesn't return anything (i waited for more than an hour). Hence I am not able to cleanup the directory. I tried reboot as well. I can see the tmpwatch is running but it is either too slow or not working at all.
Is there any (quick) way I can clean up /tmp files?
Upvotes: 0
Views: 7707
Reputation: 4384
How about:
find /tmp !-user root -delete
you can add -mtime <gracedays>
switch if you want and cron
it
Upvotes: 2
Reputation: 11
If you have an idea of the filename structure you can do something like:
find . -name "stuff*" -exec rm {} \;
To clean up old php sessions in my tmp dir, I have find . -name "sess_*" -atime +1h -exec rm {} \; in a cron job.
If you're using rm, you might get an error that there are too many files, which is why
Upvotes: 1