#!/bin/sh
## 2007-11-6
DELLOG="/usr/local/logs/del-sqlbin.log.`date +%d`"
DELTMP="/usr/local/logs/del-sqlbin.tmp"
MAIL_ADDR="xxx@xxx.xx"
exec &>$DELLOG
DT=`date +'%Y-%m-%d %T'`
SINGLE=0
sleep 30
hostname
echo `date +'%Y-%m-%d %T'`
echo "EXEC>>"
echo "PURGE MASTER LOGS BEFORE '$DT';"
echo "PURGE MASTER LOGS BEFORE '$DT';" >$DELTMP
mysql -uroot -pxxx <$DELTM...