2 # - This script rotates the normal query-log and the slow-log files.
3 # Binary-log rotation is configured in /etc/mysql/debian-log-rotate.conf
4 # - All files should be in one block so that only one flush-logs is neccessary.
5 # - The error log is obsolete, messages go to syslog now.
6 /var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql.err /var/log/mysql/mysql.err /var/log/mysql/mysql-slow.log {
14 test -x /usr/bin/mysqladmin || exit 0
16 # If this fails, check debian.conf!
17 export HOME=/etc/mysql/my.cnf
18 MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
19 if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
20 # Really no mysqld or rather a missing debian-sys-maint user?
21 # If this occurs and is not a error please report a bug.
22 if ps cax | grep -q mysqld; then
28 errlogs=`ls /var/log/mysql.err* /var/log/mysql/mysql.err* 2>/dev/null`
29 if [ -n "$errlogs" ]; then
30 chown root:adm $errlogs