Moved database name to front of backup file name

This commit is contained in:
Matthew McKinnon 2015-03-30 22:33:53 +10:00
parent 27ec402ddb
commit e78dac1554

View File

@ -10,7 +10,7 @@ databases=`mysql --user=$DBUSER --password=$DBPASS -e "SHOW DATABASES;" | tr -d
for db in $databases; do
if [[ "$db" != "information_schema" ]] && [[ "$db" != "performance_schema" ]] && [[ "$db" != "mysql" ]] && [[ "$db" != _* ]] ; then
echo "Dumping database: $db"
mysqldump --force --opt --user=$DBUSER --password=$DBPASS --databases $db > $BACKUPDIR/`date +%Y%m%d`.$db.sql
mysqldump --force --opt --user=$DBUSER --password=$DBPASS --databases $db > $BACKUPDIR/$db.`date +%Y%m%d`.sql
fi