> Hello all:
> 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?
> Thank you!
Look at the date in your e-mail. You're 2 years ago.
Not coming at you, but, I think the better approach to
truncating/archiving/otherwise managing logfiles is better viewed from a
date perspective than a size perspective. i.e. Archive my log to
mysql.19990731.log at the end of July. In UNIX-speak, this is a simple
batch file like:
cat /usr/local/var/mysql.log > /backupdir/mysql.`date +%Y%m%d`.log
echo '' > /usr/local/var/mysql.log
mysqladmin -umysql -ppasswd flush-logs
And, adding the appropriate crontab entry.
Of course, if you're living in a WinNT world with MySQL, you'll need to
do some creative perl/batch programming similar to this end, and, use
WinAT, or start - cmd - at and create the respective scheduled job.
Hope that helps.
Linux rocks!!! http://www.dedserius.com