2016-10-09 22:39:01 +02:00
|
|
|
# - I put everything in one block and added sharedscripts, so that mysql gets
|
2012-01-23 12:20:16 +01:00
|
|
|
# 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.
|
2016-10-09 22:39:01 +02:00
|
|
|
/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log {
|
2012-01-23 12:20:16 +01:00
|
|
|
daily
|
|
|
|
rotate 7
|
|
|
|
missingok
|
|
|
|
create 640 mysql adm
|
|
|
|
compress
|
|
|
|
sharedscripts
|
|
|
|
postrotate
|
2016-03-10 10:08:34 +01:00
|
|
|
test -x /usr/bin/mysqladmin || exit 0
|
2019-04-03 08:54:06 +02:00
|
|
|
# check if server is running
|
|
|
|
if mysqladmin ping > /dev/null 2>&1; then
|
2017-02-28 11:47:44 +01:00
|
|
|
mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log \
|
|
|
|
flush-engine-log flush-general-log flush-slow-log
|
2016-03-10 10:08:34 +01:00
|
|
|
fi
|
2012-01-23 12:20:16 +01:00
|
|
|
endscript
|
|
|
|
}
|