Jul 05

#!/bin/bash
#destination directory named with daily date
DIR=”/var/backup/mysql/$(date +%m%d%Y)”
if [ -d $DIR ]; then
    echo “Dir $DIR exists”;
else
    echo “Creating $DIR”;
    mkdir $DIR
fi

USER=”root”
ROOT_PASSWORD=”root_password”

#get list of databases
LIST=`mysql -u $USER -p$ROOT_PASSWORD -e”show databases” -s |egrep -v ‘Database|information_schema|mysql|temp’`

Continue reading »

written by MG \\ tags: , ,