Skip to content

Commit 10eed3d

Browse files
authored
Wait another mysqldump to finish before we use mysqldump
1 parent 8c97cc4 commit 10eed3d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bin/v-backup-user

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,19 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
412412
dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz"
413413
grants="$tmpdir/db/$database/conf/$database.$TYPE.$DBUSER"
414414
if [ ! -f "$dumpgz" ]; then
415+
416+
while true
417+
do
418+
if pgrep -x "mysqldump" > /dev/null
419+
then
420+
echo "Wait other mysqldump to finish"
421+
sleep 1
422+
else
423+
echo "We can use mysqldump now"
424+
break
425+
fi
426+
done
427+
415428
case $TYPE in
416429
mysql) dump_mysql_database ;;
417430
pgsql) dump_pgsql_database ;;

0 commit comments

Comments
 (0)