Page 1 of 1

Mysql log file too large

Posted: Fri Mar 11, 2022 6:57 am
by vapaka
My server had 100% disk usage.
Upon investigating, I found that mysql log file was taking 36GB of space.
How do I prevent it from happening again?

Location of log file:
/var/lib/mysql/vestacp.log

I am running ubuntu 20.04 and Hestia version v1.5.10.

Re: Mysql log file too large

Posted: Mon Mar 21, 2022 12:17 pm
by sandro
One solution is to use the logrotate command via cron.

Re: Mysql log file too large

Posted: Mon Mar 28, 2022 8:07 am
by nina266
sandro wrote:
Mon Mar 21, 2022 12:17 pm
One solution is to use the logrotate command via cron.
Hello, how to do that please?

Re: Mysql log file too large

Posted: Thu Mar 31, 2022 1:05 pm
by sandro
Try including the following lines in the /etc/logrotate.d/vesta file:

/var/lib/mysql/vestacp.log {
create 600 mysql mysql
missingok
notifempty
daily
rotate 3
compress
}

Check that files like vestacp.log-20220331.gz are created in the /var/lib/mysql directory and make the necessary adjustments to make it the way you need it.