[pve-devel] [PATCH manager] vzdump: also warn when hook script fails for backup-abort or log-end phase

Fiona Ebner f.ebner at proxmox.com
Mon Jan 22 10:55:21 CET 2024


to make it more visible, also in task logs.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/VZDump.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 4185ed62..98641f5a 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -1269,6 +1269,7 @@ sub exec_backup_task {
 	debugmsg ('info', "Failed at " . strftime("%F %H:%M:%S", localtime()));
 
 	eval { $self->run_hook_script ('backup-abort', $task, $logfd); };
+	debugmsg('warn', $@) if $@; # message already contains command with phase name
 
     } else {
 	$task->{state} = 'ok';
@@ -1300,6 +1301,7 @@ sub exec_backup_task {
     }
 
     eval { $self->run_hook_script ('log-end', $task); };
+    debugmsg('warn', $@) if $@; # message already contains command with phase name
 
     die $err if $err && $err =~ m/^interrupted by signal$/;
 }
-- 
2.39.2





More information about the pve-devel mailing list