Skip to content

Commit e167c2e

Browse files
committed
Notify users when backup fails always
1 parent e3cc8ac commit e167c2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/v-backup-user

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ let u_disk=$(grep "U_DISK=" $HESTIA/data/users/$user/user.conf |cut -f 2 -d \')*
7070
let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
7171

7272
if [ "$u_disk" -gt "$v_disk" ]; then
73-
echo "not enough diskspace available to perform the backup." |$SENDMAIL -s "$subj" $email $notify
73+
# Always notify on failure
74+
echo "not enough diskspace available to perform the backup." | $SENDMAIL -s "$subj" $email "yes"
7475
check_result $E_LIMIT "not enough diskspace available to perform the backup."
7576
fi
7677

@@ -82,7 +83,7 @@ fi
8283
tmpdir=$(mktemp -p $BACKUP_TEMP -d)
8384

8485
if [ "$?" -ne 0 ]; then
85-
echo "Can't create tmp dir $tmpdir" |$SENDMAIL -s "$subj" $email $notify
86+
echo "Can't create tmp dir $tmpdir" |$SENDMAIL -s "$subj" $email "yes"
8687
check_result $E_NOTEXIST "can't create tmp dir"
8788
fi
8889

0 commit comments

Comments
 (0)