Skip to content

Commit adda452

Browse files
committed
Merge branch 'dev'
2 parents 5653d2e + 7c055f5 commit adda452

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

backup.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ MYSQLDUMP_DEFAULTS="${MYSQL_CONN} ${EXPERT_ARGS}"
6060

6161
DB_LIST_SQL="SELECT schema_name FROM information_schema.schemata"
6262

63-
# If ${SKIP_DATABASES} is not empty, create a where chain
63+
# If ${SKIP_DATABASES} is not empty, create a where chain
6464
if [ ! -z "${SKIP_DATABASES}" ]; then
6565
DB_LIST_SQL="${DB_LIST_SQL} WHERE schema_name NOT IN ("
6666
# Split on ,
@@ -73,7 +73,7 @@ if [ ! -z "${SKIP_DATABASES}" ]; then
7373
fi
7474
# echo -e "${DB_LIST_SQL}"
7575
# Get result
76-
DB_LIST=`mysql ${MYSQL_CONN} -ANe"${DB_LIST_SQL}"`
76+
DB_LIST=$(mysql ${MYSQL_CONN} -ANe"${DB_LIST_SQL}")
7777

7878
if [ "$?" -ne 0 ]; then
7979
exitWithMsg 204 "Databases listing failed"
@@ -89,7 +89,7 @@ done
8989

9090
VIEW_LIST_SQL="SET SESSION group_concat_max_len = 1000000;SELECT IFNULL(GROUP_CONCAT(concat(':!\`',table_schema,'\`.\`',table_name,'\`') SEPARATOR ''),'') FROM information_schema.views"
9191

92-
# If ${SKIP_DATABASES} is not empty, create a where chain
92+
# If ${SKIP_DATABASES} is not empty, create a where chain
9393
if [ ! -z "${SKIP_DATABASES}" ]; then
9494
VIEW_LIST_SQL="${VIEW_LIST_SQL} WHERE table_schema NOT IN ("
9595
# Split on ,
@@ -104,7 +104,7 @@ else
104104
fi
105105

106106
# Get result
107-
VIEWS_LIST=`mysql ${MYSQL_CONN} -ANe"${VIEW_LIST_SQL}"`
107+
VIEWS_LIST=$(mysql ${MYSQL_CONN} -ANe"${VIEW_LIST_SQL}")
108108

109109
if [ "$?" -ne 0 ]; then
110110
exitWithMsg 204 "Views listing failed"
@@ -191,7 +191,7 @@ fi
191191
echo "Grants ..."
192192
# Needs refactor
193193
GRANTS_SQL="select distinct concat( \"SHOW GRANTS FOR '\",user,\"'@'\",host,\"';\" ) from mysql.user WHERE user != 'root';"
194-
GRANTS_LIST=`mysql ${MYSQL_CONN} -ANe"${GRANTS_SQL}"`
194+
GRANTS_LIST=$(mysql ${MYSQL_CONN} -ANe"${GRANTS_SQL}")
195195
echo ${GRANTS_LIST} | mysql --default-character-set=utf8 --skip-comments ${MYSQL_CONN} | sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/-- \1 --/;/--/{x;p;x;}' > ${BACKUP_DIR}/grants.sql
196196

197197
if [ "$?" -ne 0 ]; then

0 commit comments

Comments
 (0)