home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20110502.etc.tar.gz / bradford.20110502.etc.tar / etc / logrotate.d / mysql < prev    next >
Text File  |  2006-09-13  |  1KB  |  45 lines

  1. # This logname can be set in /etc/my.cnf
  2. # by setting the variable "err-log"
  3. # in the [safe_mysqld] section as follows:
  4. #
  5. # [safe_mysqld]
  6. # err-log=/var/lib/mysql/mysqld.log
  7. #
  8. # If the root user has a password you have to create a
  9. # /root/.my.cnf configuration file with the following
  10. # content:
  11. #
  12. # [mysqladmin]
  13. # password = <secret> 
  14. # user= root
  15. #
  16. # where "<secret>" is the password. 
  17. #
  18. # ATTENTION: This /root/.my.cnf should be readable ONLY
  19. # for root !
  20.  
  21. /var/lib/mysql/mysqld.log {
  22.         # create 600 mysql mysql
  23.         notifempty
  24.     daily
  25.         rotate 3
  26.         missingok
  27.         compress
  28.     postrotate
  29.     # just if mysqld is really running
  30.     if test -x /usr/bin/mysqladmin && \
  31.        /usr/bin/mysqladmin ping &>/dev/null
  32.     then
  33.        /usr/bin/mysqladmin flush-logs
  34.        ret=$?
  35.        if test $ret -ne 0
  36.        then
  37.           echo "/etc/logrotate.d/mysql failed, probably because" >&2
  38.           echo "the root acount is protected by password." >&2
  39.           echo "See comments in /etc/logrotate/mysql on how to fix this" >&2
  40.           exit $ret
  41.        fi
  42.     fi
  43.     endscript
  44. }
  45.