MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Ralph Graulich Date:August 4 1999 6:46am
Subject:Re: About mysql log file!
View as plain text  

>    My mysql database has very large size log file in my disk. I want to
>remove the log file when log more than 10M size.
>How to do?

Assuming that you're using a unix version of mySQL, you can write a small
shell script checking the size of the logfile. Put this shell script in the
crontab for the mySQL user and let it check every minute. In case the
logfile reaches the given size, do a mysql-logrotate or use

  mysqladmin refresh

resulting in closing the old logfile, making a new empty one with an
incremented number in the filename. Now you can just gzip the old logfile,
delete it, copy it, FTP it, mail it or save it to /dev/null :-)

... Ralph ...

Ralph Graulich, Hasengrund 22, 77654 Offenburg, - GERMANY -
Tel    +49 781 41517 (priv.)      +49 781 504 4003 (office)
Fax    +49 781 41518 (priv.)      +49 781 504 4099 (office)

private homepage  
thoroughbred stud Karlshof
horse breeding pages       

About mysql log file!George4 Aug
  • Re: About mysql log file!Van4 Aug
  • Re: About mysql log file!Ralph Graulich4 Aug
RE: About mysql log file!Quentin Bennett4 Aug