The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Managing Used Space

Discussion in 'General Discussion' started by phild, Apr 21, 2014.

  1. phild

    phild Member

    Joined:
    Dec 2, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    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.
     
  3. phild

    phild Member

    Joined:
    Dec 2, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Thank you very much for the info - much appreciated. That space is one heck of an important space!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page