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.

/usr directory keeps filling up.

Discussion in 'General Discussion' started by jols, Aug 27, 2009.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    We've got the /usr directory getting very close to 90% full on about half of our servers, even our newest server, just put on line a couple of weeks ago has /usr at 84%.

    Anyone have any idea how to keep this one from getting so full?

    Thanks in advance for any help with this.
     
  2. rahulm

    rahulm Member

    Joined:
    Jan 19, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    /usr contain apache logs in directory /usr/local/apache/logs/ you have to check log files size. You can empty the file by running following command.

    echo > error_log

    /usr partition also contain domlogs of every domain. It uses the more disk space. You can move /usr/local/apache/domlogs directory to /home/


    Regards,
    Rahul Mudavadkar
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    In this scenario where one finds logs are the culprit of large disk space consumption, I recommend enabling log rotation so it is easier to archive old logs (if they need to be archived) or simply delete archived logs.

    There are two screens in WHM that deal with log rotation, one for Apache logs and the other for cPanel logs. To enable log rotation for Apache logs, you would go to WHM -> Service Configuration -> Apache Configuration -> Log Rotation. To enable log rotation for cPanel logs, go to WHM -> Service Configuration -> cPanel Log Rotation Configuration. Both screens have text at the top indicating where the logs will be archived to.
     
  4. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Thanks Rahul. Pardon my newbie grade question here, but what exactly does "echo > error_log" do? Does this just wipe all the error logs?

    Yes, but isn't there another step? After moving /domlogs directory to /home/ wouldn't you also have to change some references in the cPanel system so that the logs in this new location will continue to update and be accessed by such stuff as AWStats, etc.?
     
  5. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Okay, I think I know the answer to my "another step?" question above. We will just create a symlink so the system can still find the domlogs directory.

    Sound about right?

    Thanks much for your help.
     
  6. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Okay, did that, and also found two rather large directories in /usr/local named

    apache.backup

    and

    apache.backup.archive

    Once moved to /root, the /usr dir is now back down to reasonable levels.

    Just in case this helps someone else having the same issue.

    Thanks.
     
  7. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Thanks. I always wanted to know what those features are as in the cPanel documentation it says nothing about it besides it just rotate logs.

    Whats the advantage or disadvantage of having this in use? Will it affect webstats?

    I assume by your post that its safe to delete archived logs then.
     
  8. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Would you mind doing a bit more of a step one step two on this? I think many of us have the same problem with the /usr partition... TIA!

    Shortz
     
  9. jenlepp

    jenlepp Well-Known Member

    Joined:
    Jul 4, 2005
    Messages:
    116
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Liberty Hill, TX
    cPanel Access Level:
    DataCenter Provider
    wrong thread. I've been working too much today. :)
     
    #9 jenlepp, Dec 6, 2009
    Last edited: Dec 6, 2009
  10. sharmaine001

    sharmaine001 Well-Known Member

    Joined:
    Jun 23, 2006
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    I dont think this works. I enabled all logs to rotate but its not rotating even if the file is greater than 300mb already
     
  11. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Friendly Moderator Note

    Please do not cross-post about the same issue in different threads or forum areas.

    Please use your original thread for continued assistance:
    Is cpanel log rotation ever works? - cPanel Forums

    Thank you for your understanding.
     
Loading...

Share This Page