1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need more space in /usr. Can I remove these directories?

Discussion in 'Workarounds and Optimization' started by jols, Jan 15, 2010.

  1. jols

    jols Active Member

    Joined:
    Mar 13, 2004
    Messages:
    1,094
    Likes Received:
    2
    Trophy Points:
    38
    Can I safely remove these directories?

    /usr/local/apache.backup_archive
    /usr/local/apache.backup
    /usr/local/cpanel-rollback

    It's probably a goofy question, but I just want to make sure. Our /usr dir is at 90%.

    Thanks much.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,117
    Likes Received:
    31
    Trophy Points:
    48
    Location:
    Pennsylvania
    As long as you're sure your Apache is working as expected, yes. The third one on your list is created from the option on the Tweak Settings page:

    you might want to untick that if you haven't already.
     
  3. jols

    jols Active Member

    Joined:
    Mar 13, 2004
    Messages:
    1,094
    Likes Received:
    2
    Trophy Points:
    38
    Cool, that got me back down to 80% in /usr

    Thanks for your response!
     
  4. ModServ

    ModServ Member

    Joined:
    Oct 17, 2006
    Messages:
    229
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Egypt
    You can also remove the contens in those 2 folder

    /usr/local/apache/logs/
    /usr/local/apache/domlogs/
     
  5. MikekiM

    MikekiM New Member

    Joined:
    Jan 21, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I have a bunch of files on /usr/local/cpanel/src/3rdparty/gpl
    Is it ok to delete these? They appear to be backups or something.
     
  6. jols

    jols Active Member

    Joined:
    Mar 13, 2004
    Messages:
    1,094
    Likes Received:
    2
    Trophy Points:
    38
    I would like to know this as well. I'll bet the .tar.gz files in this directory can be safely removed, but I would like to get confirmation of this before doing so.
     
  7. ModServ

    ModServ Member

    Joined:
    Oct 17, 2006
    Messages:
    229
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Egypt
    As of my experience and knowledge, It's safe to remove it as the folder name is /src/ then it's sources for the files, But I don't know if those files are needed sometime from cPanel.
     
  8. Kent Brockman

    Kent Brockman Active Member

    Joined:
    Jan 20, 2008
    Messages:
    1,064
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Buenos Aires, Argentina
    Yep, these files seems to be the source being downloaded every time a cpanel update is performed. I BELIEVE that should be safe to delete files with older date than a year.

    If anybody at staff can confirm this, I could delete about 600 MB of dump :)
     
  9. Srv24x7

    Srv24x7 New Member

    Joined:
    May 22, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    move domlogs

    Move the domlogs folder from /usr/local/apache/domlogs to /home and create a symbolic link , That should provide you more space on /usr.
     
  10. Kent Brockman

    Kent Brockman Active Member

    Joined:
    Jan 20, 2008
    Messages:
    1,064
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Buenos Aires, Argentina
    ok, but what if, as in my personal issue, I don't have multiple partitions and everything is working in the same disk?
     
  11. YasminTiara

    YasminTiara New Member

    Joined:
    Mar 18, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    some thing is new to know thanks
     
  12. golden_eyes

    golden_eyes Member

    Joined:
    Aug 9, 2010
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    I deleted a directory its size 1.6G after that I ran the following commands:

    root@web [/usr]# du -sh
    6.7G .
    root@web [/usr]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda6 7.8G 1006M 6.4G 14% /
    /dev/sdb1 903G 554G 302G 65% /backup
    /dev/sda8 823G 33G 749G 5% /home
    /dev/sda3 9.7G 8.5G 738M 93% /usr
    /dev/sda2 49G 3.8G 43G 9% /var
    /dev/sda1 99M 24M 71M 25% /boot
    /dev/sda5 9.7G 161M 9.1G 2% /tmp
    tmpfs 2.0G 0 2.0G 0% /dev/shm

    it seems there is wrong with the calculation size.
     
  13. ModServ

    ModServ Member

    Joined:
    Oct 17, 2006
    Messages:
    229
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Egypt
    Try running

    Code:
    /scripts/fixquotas
    But for your knowledge this will take a lot of time and the HDD will become so slow till this operation is finished.
     
  14. golden_eyes

    golden_eyes Member

    Joined:
    Aug 9, 2010
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    to avoid this slow till the operation is finished, so to fix this just reboot the server. But because I really wanted to narrow it down and just restart a service or two find out whats running in that partition I ran this command
    Code:
    lsof |grep /usr|awk '{print $1}'|sort|uniq -c
    finally I got it :) it was the service httpd stop then start
     
  15. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    I would not suggest performing this action for anyone who reads the above post. If you delete the log files, then you won't have that logging data, which is used for stats purposes as well as error logs (the /usr/local/apache/logs/error_log has the Apache error logs).

    It is definitely possible to move the domlogs to /home and symlink them, but I would not suggest removing these files. Many customers and sites want their statistical data, which will be lost by removing the domlogs. Not to mention, if you have a daily stats run, the domlog files will simply reform right after then as the logging acquires new data to log to the files.

    In order to move the domlogs, you could handle it this way:

    Code:
    cd /usr/local/apache
    mv domlogs /home/domlogs
    cd /home
    ln -s domlogs /usr/local/apache/domlogs
    By moving the directory, you are preserving the ownership permissions, then you are symlinking the moved domlogs in /home back to the prior location so that the same log processing can occur.
     
  16. jols

    jols Active Member

    Joined:
    Mar 13, 2004
    Messages:
    1,094
    Likes Received:
    2
    Trophy Points:
    38
    I second that emotion.

    And before I did anything this extravagant, I would first do this (you SHOULD be safe with the following, but anything I suggest is done at your own risk!):

    rm -rf /usr/local/cpanel/src/3rdparty/gpl/*.gz
    rm -rf /usr/local/apache.backup_archive
    rm -rf /usr/local/cpanel-rollback
    ------------
    cd /usr/local/apache/logs

    rm -rf suexec_log
    touch suexec_log
    chown root:nobody suexec_log
    chmod 600 suexec_log

    rm -rf suphp_log
    touch suphp_log
    chown root:nobody suphp_log
    chmod 600 suphp_log
    ------------

    cd /var/spool/mqueue/.razor
    rm -rf razor-agent.log

    ------------


    Also, we've found that the /mailman/archives directory can take up a ton of space. So just do this:

    /usr/local/cpanel/3rdparty/mailman/bin/mailmanctl -s stop
    mkdir /home/cpanelutilities
    mv /usr/local/cpanel/3rdparty/mailman/archives /home/cpanelutilities/archives
    ln -s /home/cpanelutilities/archives /usr/local/cpanel/3rdparty/mailman/archives
    /usr/local/cpanel/3rdparty/mailman/bin/mailmanctl -s start


    The latter method just above is better than moving the entire /domlogs directory to /home IMHO
     
  17. golden_eyes

    golden_eyes Member

    Joined:
    Aug 9, 2010
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your notification, for sure I will never touch the logs but I'm removing the log of the forums inside domlogs, but the better solution is to move them to the home instead of the /usr.
     
  18. hbidad

    hbidad Member

    Joined:
    Apr 16, 2005
    Messages:
    74
    Likes Received:
    1
    Trophy Points:
    8
    Why the need for -r? Why remove, recreate, and reassign ?

    [root@chris2 ~]# ll 1G
    -rw-r--r-- 1 root nobody 1073741824 Apr 27 08:28 1G
    [root@chris2 ~]# echo > 1G
    [root@chris2 ~]# ll 1G
    -rw-r--r-- 1 root nobody 1 Apr 27 08:29 1G
    [root@chris2 ~]#
     
    #18 hbidad, Apr 26, 2011
    Last edited: Apr 26, 2011
  19. golden_eyes

    golden_eyes Member

    Joined:
    Aug 9, 2010
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Code:
    Why the need for -r? Why remove, recreate, and reassign ?
    
    [root@chris2 ~]# ll 1G
    -rw-r--r-- 1 root nobody 1073741824 Apr 27 08:28 1G
    [root@chris2 ~]# echo > 1G
    [root@chris2 ~]# ll 1G
    -rw-r--r-- 1 root nobody 1 Apr 27 08:29 1G
    [root@chris2 ~]# 
    Because you cant keep the logs folder without error_log and all rest folder, without above commands such you are empty the file from inside the logs
     
  20. JeffP.

    JeffP. Member

    Joined:
    Sep 28, 2010
    Messages:
    164
    Likes Received:
    4
    Trophy Points:
    18
    Even easier:

    Code:
    [root@host ~]# >1G
    Note: I do not recommend emptying log files. This is only a demonstration of the shortest possible way to empty a file.
     

Share This Page