Skip to content

Commit 83cfa98

Browse files
Issue when backup multiple databaes or when password is different then /root/.mysql password (hestiacp#2396)
* Issue when backup multiple databaes or when password is different then /root/.mysql password * Fix typo Co-authored-by: Raphael Schneeberger <rs@scit.ch>
1 parent e3c2147 commit 83cfa98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

func/db.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ mysql_query() {
9696

9797
mysql_dump() {
9898
err="/tmp/e.mysql"
99-
mysqldump --defaults-extra-file=$mycnf --single-transaction --routines -r $1 $2 2> $err
99+
mysqldump --defaults-file=$mycnf --single-transaction --routines -r $1 $2 2> $err
100100
if [ '0' -ne "$?" ]; then
101+
mysqldump --defaults-extra-file=$mycnf --single-transaction --routines -r $1 $2 2> $err
102+
if [ '0' -ne "$?" ]; then
101103
rm -rf $tmpdir
102104
if [ "$notify" != 'no' ]; then
103105
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
@@ -108,6 +110,7 @@ mysql_dump() {
108110
echo "Error: dump $database failed"
109111
log_event "$E_DB" "$ARGUMENTS"
110112
exit "$E_DB"
113+
fi
111114
fi
112115
}
113116

0 commit comments

Comments
 (0)