Portal Home > Knowledgebase > Articles Database > Is it safe to remove all of /tmp?


Is it safe to remove all of /tmp?




Posted by VL-Adam, 07-06-2009, 12:49 AM
My /tmp on my cPanel hosting server is nearly full, and I was wondering if it is safe to remove all the contents in /tmp, if not, what can I delete to clear up the space? Thank you!

Posted by AquariusStorage, 07-06-2009, 12:52 AM
Lol no you're not going to want to delete everything in your tmp folder. You need to keep things such as mysql.sock and aquota.user/quota.user. Do the followingin SSH to see what is so big and then more then likely it will be safe to delete that. Do you have eaccelerator installed or something? If you do, I've noticed eaccelerator seems to not clear its cache from the tmp folder and just seems to leave it there. You can create a crontab to empty the eaccelerator folder if your tmp folder fills up often and it is because of this.

Posted by linux-engineer, 07-06-2009, 01:52 AM
Hello, You can remove the session files from /tmp. Find files with ownership nobody and delete them. Thank you

Posted by inspiron, 07-06-2009, 07:58 AM
Yes, you can delete the sess files from the /tmp folder by using, # cd /tmp # rm -rf sess_* but before using this command, make sure that you are in the /tmp directory.

Posted by whmcsguru, 07-06-2009, 11:44 AM
Nothing in tmp should ever be permanent so theoretically it is safe yes. Tmp shouldn't have or need a quota set up as it is entirely too small for it

Posted by VL-Adam, 07-06-2009, 06:14 PM
Thanks guys! Removing the session files worked like a charm!

Posted by koithara, 07-07-2009, 08:54 AM
Hi, You may need to use a command called tmpwatch which removes files which haven’t been accessed for a period of time. Normally, it’s used to clean up directories which are used for temporary holding space such as /tmp. Following code will remove all files/dirs from /tmp if they are not accessed in last 2 weeks (24 * 14 days = 336)



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
EZPZ Hosting Review (Views: 995)
SQl Injection? (Views: 759)