Two WHM Backup log files taking up 160G
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
-
Hello :) Those are backups of your MySQL error log. You are welcome to remove that file if you do not require a backup for it. Thank you. 0 -
[quote="cPanelMichael, post: 1470911">Hello :) Those are backups of your MySQL error log. You are welcome to remove that file if you do not require a backup for it. Thank you.
Thank you for your reply. Will the backups automatically create a new file if I delete it?0 -
Are you referring to the MySQL error log itself, or the backed up version of the file? Thank you. 0 -
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! 0 -
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. 0 -
[quote="cPanelMichael, post: 1470961">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.
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!0 -
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. 0
Please sign in to leave a comment.
Comments
7 comments