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.

Two WHM Backup log files taking up 160G

Discussion in 'General Discussion' started by tntramsey, Sep 27, 2013.

  1. tntramsey

    tntramsey Registered

    Joined:
    Sep 27, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I have been running backups of a dedicated server for a while now and I have extrememly large .log files. I am surprised at how large they accumulate to and wondering if it is ok to just delete them.

    ./backup/cpbackup/daily/dirs/_var_lib_mysql_/servername.log: 90G
    ./backup/cpbackup/weekly/dirs/_var_lib_mysql_/servername.log: 90G


    Anyone have any advice?

    Thanks,
    Tim
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. tntramsey

    tntramsey Registered

    Joined:
    Sep 27, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you for your reply. Will the backups automatically create a new file if I delete it?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. tntramsey

    tntramsey Registered

    Joined:
    Sep 27, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    For informational purposes - both, but I assume that the error log itself will automatically populate.

    If I remove the backup, will it cease to backup mysql error log? What do most people/companies do about this, because as we can see I have 180G of space taken up with two backup files.

    I really appreciate your input!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Check your /etc/my.cnf file to see if you are logging slow queries. That could be what's making your MySQL error log use so much space. Beyond that, you could add your MySQL error log to your logrotate configuration if you have logrotate installed. This would prevent it from ever reaching a large size, and negate the need to delete it or exclude it from your backups. Also, you can configure MySQL to store the log in another directory outside of /var/lib/mysql so that it's not included when the entire MySQL directory is backed up.

    Thank you.
     
  7. tntramsey

    tntramsey Registered

    Joined:
    Sep 27, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    So is "error_log" the box that I should check to rotate the mysql log file? So from reading, it looks like it will compress it and store it in "/usr/local/cpanel/logs/archive/" after it reaches the threshold, and I would be responsible for going in and deleting from there?

    Any input would be appreciated.

    Thanks!
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    No, the log rotation files you see in Web Host Manager are not associated with MySQL. You would need to configure LogRotate manually to ensure your MySQL error log is rotated.

    Thank you.
     
Loading...

Share This Page