My script backuping up alla databases which is in my datadir.
It's works for me.


#!/bin/sh

USER=root
PASSWORD=somepassword
BACKUPTYPE=daily

if [ -x $BACKUPTYPE ]
then
        echo "$0 <Backup typ>"
        exit 0
fi

for i in `ls /var/mysql|grep -E -v ".pid|.err"` ; do
        DB=$i ; DATE=$BACKUPTYPE ; rm -rf/home/backup/mysql/$DB\_$DATE.sql.gz ; 
/usr/local/mysql/bin/mysqldump -u $USER -p$PASSWORD --opt $DB 
>/home/backup/mysql/$DB\_$DATE.sql ; /bin/gzip /home/backup/mysql/$DB\_$DATE.sql
        if [ ! -x $2 ]
        then
                echo "Backing up: $i"
        fi
done

 On Fri, 9 Feb 2001, T. Stephen Dachtera wrote:

> I am wondering, if it is possible to use MySQL and create a shell script to
> backup tables from a database on a cron?  If anyone has an idea if this is
> possible, and how I might go about it, it would be much appreciated!


---------------------------------------------------------------------
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