#!/bin/sh # # MySQL backups from the Data MOUNTED=`grep /etc/mtab -e \/mnt\/backup` if [ "$MOUNTED" = '' ]; then echo "/mnt/backup is not mounted, there is no drive to backup to" exit 1 fi mkdir -p /mnt/backup/cluster_sql for i in $(echo 'SHOW DATABASES;' | mysql -ubackup -pSUPERSECRET -hData|grep -v '^Database$'); do mysqldump -ubackup -pSUPERSECRET -hData --opt $i > /mnt/backup/cluster_sql/$i.sql; done;
You need to create an account or log in to post comments to this site.