Skip to content

Commit cf1d367

Browse files
author
buildplan
committed
fix background_restore notification
1 parent fbcf178 commit cf1d367

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

restic-backup.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,11 @@ run_background_restore() {
13991399
local end_time=$(date +%s)
14001400
local duration=$((end_time - start_time))
14011401
log_message "Background restore SUCCESS: ${snapshot_id} to ${restore_dest} in ${duration}s."
1402+
local notification_message
1403+
printf -v notification_message "Successfully restored snapshot %s to %s in %dm %ds." \
1404+
"${snapshot_id:0:8}" "${restore_dest}" "$((duration / 60))" "$((duration % 60))"
14021405
send_notification "Restore SUCCESS: $HOSTNAME" "white_check_mark" \
1403-
"${NTFY_PRIORITY_SUCCESS}" "success" "Successfully restored snapshot ${snapshot_id:0:8} to ${restore_dest} in $((duration / 60))m ${duration % 60}s."
1406+
"${NTFY_PRIORITY_SUCCESS}" "success" "$notification_message"
14041407
else
14051408
log_message "Background restore FAILED: ${snapshot_id} to ${restore_dest}."
14061409
send_notification "Restore FAILED: $HOSTNAME" "x" \

0 commit comments

Comments
 (0)