File: mysql-server.logrotate

package info (click to toggle)
mysql 3.23.49-8.13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 65,624 kB
  • ctags: 45,242
  • sloc: ansic: 255,722; cpp: 86,801; perl: 26,117; tcl: 19,882; sh: 18,775; asm: 4,001; yacc: 2,626; makefile: 2,494; java: 2,300; awk: 1,484; sed: 428
file content (22 lines) | stat: -rw-r--r-- 685 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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.
/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql.err /var/log/mysql/mysql.err {
	daily
	rotate 7
	missingok
	create 600 mysql mysql
	compress
	sharedscripts
	postrotate
		export HOME=/etc/mysql/my.cnf
		MYADMIN="/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf"
		if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then
		  $MYADMIN flush-logs
		fi
		errlogs=`ls /var/log/mysql.err* /var/log/mysql/mysql.err* 2>/dev/null`
		if [ -n "$errlogs" ]; then 
		  chown 0.0 $errlogs
		fi
	endscript
}