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.

Huge Error Logs

Discussion in 'General Discussion' started by DreamPhysix, Aug 12, 2011.

  1. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    I recently discovered that my sites with high traffic were using gigabytes more disk space than they should because of error_log filling up in the document root. Does cPanel have a tool or is there a tweak so I can keep these from growing so large? Please advise. The logs are generated from PHP i believe
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    There isn't a tweak or any tool to cull the size of error_log files created in /home/username/public_html or higher location. You could always have something periodically clearing the file with something like the following:

    Code:
    for i in `find /home/*/public_html -type f -name error_log` ;do >$i ;done
    This could be cron set to run once a week in /var/spool/cron/root (root's crontab file).
     
  3. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    thank you, that does exactly what i want
     
    #3 DreamPhysix, Aug 12, 2011
    Last edited: Aug 12, 2011
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    That was already mentioned in my reply:

    I mentioned that location because the command I provided immediately after did do that.

    Feel free to test the command to see the results. You could always create a file inside /home/username/public_html/somefolder/error_log to see it clears that file.
     
  5. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for that simple solution.
     
Loading...

Share This Page