Skip to content

Commit 90eabfd

Browse files
authored
Merge pull request hestiacp#921 from hestiacp/fix/918-clear_backup_pipe_after_failed_download
hestiacp#918 Clear backup.pipe after failed download
2 parents da2322c + de0d370 commit 90eabfd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/v-download-backup

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ if [ ! -e "$BACKUP/$backup" ]; then
169169
downloaded='yes'
170170
fi
171171
if [ -z "$downloaded" ]; then
172+
subj="$user → Download of $backup has failed"
173+
$BIN/v-add-user-notification $user "$subj" "Download of $backup has failed because backup file $backup doesn't exist in '${BACKUP}' folder"
174+
sed -i "/v-download-backup $user /d" $HESTIA/data/queue/backup.pipe
172175
check_result $E_NOTEXIST "backup file $backup doesn't exist in '${BACKUP}' folder"
173176
else
174177
if [ -e "$BACKUP/$backup" ]; then
@@ -190,7 +193,6 @@ if [ -e "$BACKUP/$backup" ]; then
190193
email=$(get_user_value '$CONTACT')
191194
echo "Download of $backup has been completed you are able to download it for 12 hours" |$SENDMAIL -s "$subj" $email $notify
192195
$BIN/v-add-user-notification $user "$subj" "Download of $backup has been completed you are able to download it for 12 hours"
193-
194196
fi
195197

196198
# Cleaning restore queue

0 commit comments

Comments
 (0)