all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Constantin Herold via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Constantin Herold <proxmox8914@herold.me>
Subject: [pve-devel] [PATCH pve-manager 1/1] feat: pass backup status to hook script on job-end/job-abort
Date: Tue, 23 Sep 2025 19:40:07 +0200	[thread overview]
Message-ID: <mailman.318.1758649248.390.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20250923174007.84121-1-proxmox8914@herold.me>

[-- Attachment #1: Type: message/rfc822, Size: 4734 bytes --]

From: Constantin Herold <proxmox8914@herold.me>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager 1/1] feat: pass backup status to hook script on job-end/job-abort
Date: Tue, 23 Sep 2025 19:40:07 +0200
Message-ID: <20250923174007.84121-2-proxmox8914@herold.me>

Signed-off-by: Constantin Herold <proxmox8914@herold.me>
---
 PVE/VZDump.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index defe9e0a..eab19d91 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -830,8 +830,8 @@ sub run_hook_script {
     $ENV{STOREID} = $opts->{storage} if $opts->{storage};
     $ENV{DUMPDIR} = $opts->{dumpdir} if $opts->{dumpdir};
 
-    foreach my $ek (qw(vmtype hostname target logfile)) {
-        $ENV{ uc($ek) } = $task->{$ek} if $task->{$ek};
+    foreach my $ek (qw(vmtype hostname target logfile errcount)) {
+        $ENV{ uc($ek) } = $task->{$ek} if defined $task->{$ek};
     }
 
     run_command($logfd, $cmd);
@@ -1445,7 +1445,7 @@ sub exec_backup {
         }
 
         $self->{'backup-provider'}->job_cleanup() if $self->{'backup-provider'};
-        $self->run_hook_script('job-end', undef, $job_end_fd);
+        $self->run_hook_script('job-end', { errcount => $errcount }, $job_end_fd);
     };
     my $err = $@;
 
@@ -1455,7 +1455,7 @@ sub exec_backup {
             $err .= "job cleanup for external provider failed - $@" if $@;
         }
 
-        eval { $self->run_hook_script('job-abort', undef, $job_end_fd); };
+        eval { $self->run_hook_script('job-abort', { errcount => $errcount }, $job_end_fd); };
         $err .= $@ if $@;
         debugmsg('err', "Backup job failed - $err", undef, 1);
     } else {
-- 
2.51.0



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

           reply	other threads:[~2025-09-23 17:40 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20250923174007.84121-1-proxmox8914@herold.me>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.318.1758649248.390.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=proxmox8914@herold.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal