Skip to content

Commit a071f62

Browse files
authored
Merge pull request #224 from pcrt/master
Update functions.sh
2 parents dbea4c6 + 4796889 commit a071f62

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

functions.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ function do_dump() {
125125
fi
126126
if [ -n "$DB_DUMP_BY_SCHEMA" -a "$DB_DUMP_BY_SCHEMA" = "true" ]; then
127127
if [[ -z "$DB_NAMES" ]]; then
128-
DB_NAMES=$(mysql -h $DB_SERVER -P $DB_PORT $DBUSER $DBPASS -N -e 'show databases')
128+
DB_LIST=$(mysql -h $DB_SERVER -P $DB_PORT $DBUSER $DBPASS -N -e 'show databases')
129129
[ $? -ne 0 ] && return 1
130+
else
131+
DB_LIST="$DB_NAMES"
130132
fi
131133
if [ -z "$DB_NAMES_EXCLUDE" ]; then
132134
DB_NAMES_EXCLUDE="information_schema performance_schema mysql sys"
@@ -135,7 +137,7 @@ function do_dump() {
135137
for i in $DB_NAMES_EXCLUDE; do
136138
exclude_list[$i]="true"
137139
done
138-
for onedb in $DB_NAMES; do
140+
for onedb in $DB_LIST; do
139141
if [ -v exclude_list[$onedb] ]; then
140142
# skip db if it is in the exclude list
141143
continue
@@ -468,7 +470,7 @@ function next_cron_expression() {
468470
else
469471
# if it is not a step function, just add the tmpvalid to the allvalid
470472
allvalid="$allvalid $tmpvalid"
471-
fi
473+
fi
472474
done
473475

474476
# sort for deduplication and ordering

0 commit comments

Comments
 (0)