#!/bin/sh
USERNAME=root
PASSWORD=ROOT_PASSWORT
MYSQL=/usr/bin/mysql
MYSQLDUMP=/usr/bin/mysqldump
DUMPDIR=/home/backup
DATABASES=`$MYSQL -p$PASSWORD -u $USERNAME --execute="SHOW DATABASES;" | awk '{print $1}'`
for s in $DATABASES;
do
if [ $s != "information_schema" ] && [ $s !="Database" ]
then
`$MYSQLDUMP -u$USERNAME -p$PASSWORD $s < $DUMPDIR/$s.sql`
fi
done