phild

Member
Dec 2, 2003
18
0
151
Hi,
my server became too full and so I googled how to clean it up and release space. One of the things I found was to run this command:

rm -rf /home/*/tmp/*

in about twenty seconds it had freed up several GB of space and I have to admit I panicked thinking it was wiping the drive clean so stopped it.

This is the first time I have run this command on a server that has been running for two years and contains a few hundred sites. Could it just be that the command was well overdue to be run, or is it going to to do some things I dont want it to? (although looking around, all seems ok).

Thank you in advance for your time and help.
Phil.
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
218
3
68
Indiana, USA
Personally I'd probably set up tmpwatch to clear files older than ~72 hours [or a week, or a month] for /home/*/tmp.

The idea of a temporary folder is that you can clear it's contents without damage but this may not actually always be the case [such as with the server-wide /tmp where socks may be stored and data for some running processes] although they *should* be able to recover from this gracefully.

That said - be very careful with "rm -rf" If you were to type this "rm -rf / home/*/tmp/*" instead of "rm -rf /home/*/tmp/*" you would wipe your server. This is a simple typo of an extra space.
 

phild

Member
Dec 2, 2003
18
0
151
Thank you very much for the info - much appreciated. That space is one heck of an important space!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello :)

I do not recommend utilizing that command. It will delete data that is necessary to display your statistics and bandwidth within cPanel for those accounts. Instead, I suggest first checking to see where most of your disk space usage is coming from using the instructions here:

cPanel - Manage HD Space

Thank you.