On 10-Jul-01 Jason Ziegler wrote:
> I'd like to see some that check current tables for corruption before 
> exporting, and then naming the exports by date...
> 
> 

DBS="genldgr ap ar corp misc"
DUMP=$HOME/archive/dump

cd $DUMP

DIR=`date | cut -d" " -f1`
mkdir -p $DIR
rm -f Today
ln -sf $DIR Today
cd $DIR
for K in $DBS
do
    TBLS=`mysql -N -e "show tables" $K`
    for I in $TBLS
    do
        mysql -e "repair table $I" $K
        mysqldump -q --add-drop-table $K $I >> $K.$I.dmp
        rm -rf $K.$I.dmp.gz
        gzip $K.$I.dmp
    done
done

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to