Selasa, 28 Januari 2020

How to log rotate mysql slow query

  Tidak ada komentar
Log rotate script 
wahid@atindb mysql $ cat /etc/logrotate.d/mysql-slowlog
/var/log/mysql/mysql-slow.log {
        compress
        dateext
        size 300M
        copytruncate
        maxage 365
        dateformat -%Y%m%d%s
        daily
        rotate 30
        notifempty
}
wahid@atindb 
the result
wahid@atindb mysql $ ls -l
total 272
-rw-rw---- 1 mysql mysql 219213 Jan 28 23:12 mysql-slow.log
-rw-rw---- 1 mysql mysql  38057 Jan 28 23:06 mysql-slow.log-202001281580227618.gz
-rw-rw---- 1 mysql mysql   8216 Jan 28 23:08 mysql-slow.log-202001281580227706.gz
-rw-rw---- 1 mysql mysql   2397 Jan 28 23:09 mysql-slow.log-202001281580227747.gz
wahid@atindb mysql $

Tidak ada komentar :

Posting Komentar