2012-01-23 12:20:16 +01:00
|
|
|
# - I put everything in one block and added sharedscripts, so that mysql gets
|
|
|
|
# flush-logs'd only once.
|
|
|
|
# Else the binary logs would automatically increase by n times every day.
|
|
|
|
# - The error log is obsolete, messages go to syslog now.
|
2015-10-20 09:41:44 +02:00
|
|
|
/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mariadb-slow.log {
|
2012-01-23 12:20:16 +01:00
|
|
|
daily
|
|
|
|
rotate 7
|
|
|
|
missingok
|
|
|
|
create 640 mysql adm
|
|
|
|
compress
|
|
|
|
sharedscripts
|
|
|
|
postrotate
|
2016-03-10 13:08:34 +04:00
|
|
|
test -x /usr/bin/mysqladmin || exit 0
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-03-10 13:08:34 +04:00
|
|
|
if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then
|
|
|
|
# If this fails, check debian.conf!
|
|
|
|
mysqladmin --defaults-file=/etc/mysql/debian.cnf flush-logs
|
|
|
|
fi
|
2012-01-23 12:20:16 +01:00
|
|
|
endscript
|
|
|
|
}
|