Skip to content

Commit de0d370

Browse files
committed
hestiacp#918 Clear backup.pipe after failed download
In the following case the v-download-backup fails and the backup.pipe didn't clear 1. User creates backup 2. User deletes backup via CLI (rm backup.{data}.tar 3. User downloads backup via web interface Backup will fail on line 175 (New script) but will retry at next interval but fail again
1 parent 8c3d792 commit de0d370

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)