X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=mysql.logrotate;h=4bb78ceb9acd84287db5a16baef4e66400b9d1a3;hb=874af6dea26c9ea8027718dfb18a711c037a6028;hp=d953b89464cf12ad0143fa5d12b5edcbc0e57487;hpb=e78430072c55e90a58f88428485175f595b4bea5;p=packages%2Fmysql.git diff --git a/mysql.logrotate b/mysql.logrotate index d953b89..4bb78ce 100644 --- a/mysql.logrotate +++ b/mysql.logrotate @@ -1,43 +1,34 @@ -/var/log/mysql/err { - olddir /var/log/archiv/mysql - notifempty - create 640 mysql mysql - prerotate - /usr/bin/mysqladmin --defaults-file=/etc/mysqld.conf flush-logs - endscript - - postrotate - /usr/bin/mysqladmin --defaults-file=/etc/mysqld.conf flush-logs - endscript -} - -/var/log/mysql/log { - olddir /var/log/archiv/mysql - notifempty - missingok - create 640 mysql mysql - - prerotate - /usr/bin/mysqladmin --defaults-file=/etc/mysqld.conf flush-logs - endscript - - postrotate - /usr/bin/mysqladmin --defaults-file=/etc/mysqld.conf flush-logs - endscript -} - -/var/log/mysql/isamlog { - olddir /var/log/archiv/mysql - notifempty +# This section is used from mysqld.conf for logrotation. +# Be sure that the password in config matches the actual one. +# +# ATTENTION: The mysqld.conf should be readable ONLY for *system* root! +# +# [mysqladmin] +# user = mysql_sysadmin +# password = +# +# where "" is the password. +# +# You must do this for every active cluster defined in /etc/mysql/clusters.conf + +/var/log/mysql/query.log +/var/log/mysql/mysqld.log +/var/log/mysql/slow.log +/var/log/mysql/update* +{ + olddir /var/log/archive/mysql + notifempty missingok create 640 mysql mysql + sharedscripts - prerotate - /usr/bin/mysqladmin --defaults-file=/etc/mysqld.conf flush-logs - endscript + # NOTE: + # if you run the rotation less often than "daily" then the + # "expire-logs-days" mysqld server parameter may no longer work as you + # expect + daily postrotate - /usr/bin/mysqladmin --defaults-file=/etc/mysqld.conf flush-logs + /sbin/service mysql flush-logs endscript } -