From b25e453e224653d4456dc8f144089991dd431616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yavuz=20Ayd=C4=B1n?= Date: Mon, 28 Jan 2019 11:31:19 +0100 Subject: [PATCH] Fixed backups of databases with dash (-) in name --- backup_mysql.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup_mysql.sh b/backup_mysql.sh index 5e7627b..62d27be 100644 --- a/backup_mysql.sh +++ b/backup_mysql.sh @@ -29,6 +29,7 @@ # # ############################################################################################## # # +# 2019/01/28 1.6 Fixed backups of databases with dash (-) in name # # 2019/01/21 1.5 Fixed creation of databases with dot (.) in name # # 2018/02/11 1.4 Fixed detection of mydumper # # 2017/11/09 1.3 Fixed multiple backups on a day support # @@ -119,7 +120,7 @@ else mysqldump -R -d --single-transaction ${DB} | gzip -c > ${DB_BKP_FLDR}/000-DB_SCHEMA.sql.gz index=0 #Get the tables and its type. Store it in an array. - table_types=($(mysql -e "show table status from ${DB}" | awk '{ if ($2 == "MyISAM" || $2 == "InnoDB") print $1,$2}')) + table_types=($(mysql -e "show table status from \`${DB}\`" | awk '{ if ($2 == "MyISAM" || $2 == "InnoDB") print $1,$2}')) table_type_count=${#table_types[@]} # Loop through the tables and apply the mysqldump option according to the table type # The table specific SQL files will not contain any create info for the table schema.