File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 4747# Display the container informations on standard out.
4848#
4949
50- CONTAINER=$( export | sed -nr " /ENV_MYSQL_DATABASE /{s/^.+ -x (.+)_ENV.+/\1/p;q}" )
50+ CONTAINER=$( export | sed -nr " /ENV_MYSQL_ROOT_PASSWORD /{s/^.+ -x (.+)_ENV.+/\1/p;q}" )
5151
5252if [[ -z " ${CONTAINER} " ]]
5353then
@@ -86,7 +86,14 @@ umask ${UMASK}
8686# Building common CLI options to use for mydumper and myloader.
8787#
8888
89- CLI_OPTIONS=" -v 3 -h ${! DB_ADDR} -P ${! DB_PORT} -u root -p ${! DB_PASS} -B ${! DB_NAME} ${OPTIONS} "
89+ CLI_OPTIONS=" -v 3 -h ${! DB_ADDR} -P ${! DB_PORT} -u root -p ${! DB_PASS} ${OPTIONS} "
90+
91+ if [ -z " ${! DB_NAME} " ]; then
92+ echo " No DB_NAME available, backup all DBs"
93+ else
94+ CLI_OPTIONS=" -B ${! DB_NAME} ${CLI_OPTIONS} "
95+ fi
96+
9097
9198#
9299# When MODE is set to "BACKUP", then mydumper has to be used to backup the database.
You can’t perform that action at this time.
0 commit comments