Michael Still | 9e81421 | 2013-12-25 11:19:28 +1100 | [diff] [blame] | 1 | # - I put everything in one block and added sharedscripts, so that mysql gets |
| 2 | # flush-logs'd only once. |
| 3 | # Else the binary logs would automatically increase by n times every day. |
| 4 | # - The error log is obsolete, messages go to syslog now. |
| 5 | /var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log { |
| 6 | daily |
| 7 | rotate 7 |
| 8 | missingok |
| 9 | create 644 mysql adm |
| 10 | compress |
| 11 | sharedscripts |
| 12 | postrotate |
| 13 | test -x /usr/bin/mysqladmin || exit 0 |
| 14 | # If this fails, check debian.conf! |
| 15 | MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" |
| 16 | if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then |
| 17 | # Really no mysqld or rather a missing debian-sys-maint user? |
| 18 | # If this occurs and is not a error please report a bug. |
| 19 | #if ps cax | grep -q mysqld; then |
| 20 | if killall -q -s0 -umysql mysqld; then |
| 21 | exit 1 |
| 22 | fi |
| 23 | else |
| 24 | $MYADMIN flush-logs |
| 25 | fi |
| 26 | endscript |
| 27 | } |