#
## Criar a rotacao do log do mysql.
#

echo '
#
/opt/log-mysql/mysql.log /opt/log-mysql/error.log  {
create 640 lxd docker
dateext
dateformat -%Y.%m.%d
daily
rotate 10
missingok
compress
delaycompress
sharedscripts
#
        prerotate
                if [ -x /bin/docker ]; then
                   docker stop mysql-server
                fi
        endscript

        postrotate
                docker start mysql-server
        endscript
}

'> /etc/logrotate.d/mysql
