From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D33E81FF191 for ; Tue, 23 Sep 2025 19:40:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7E4D9142D3; Tue, 23 Sep 2025 19:40:50 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Tue, 23 Sep 2025 19:40:07 +0200 In-Reply-To: <20250923174007.84121-1-proxmox8914@herold.me> References: <20250923174007.84121-1-proxmox8914@herold.me> MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Constantin Herold via pve-devel Precedence: list Cc: Constantin Herold X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH pve-manager 1/1] feat: pass backup status to hook script on job-end/job-abort Content-Type: multipart/mixed; boundary="===============9119690086376212142==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============9119690086376212142== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id D06D5D4AC5 for ; Tue, 23 Sep 2025 19:40:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A210314250 for ; Tue, 23 Sep 2025 19:40:47 +0200 (CEST) Received: from core.fw.herold.me (unknown [IPv6:2a06:de00:1337:beef::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 23 Sep 2025 19:40:44 +0200 (CEST) From: Constantin Herold DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herold.me; s=mail; t=1758649238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UU2Yzzds+XdlYUUydn321qatPuT+7m0rSEghmzc5VYU=; b=C93AzMlKyMzRVNW65j7tV0N3u4ghqfzPxq/dDGWwHKIcrfwS2g0vbAIEdTVi/FV+2fFwFc JuYlsY26Qwz+rxeKp6seCcw1DfbjcTkI0sVEd8rqflStJ7+6B+rovxx8wg3j9pSZrO7gGO XGmr2jLs5k8KaMIvjBcEW4Gkuq4ea+xBih2haqgSoRh1MvLLq2b1MkzCYrKhIBny7UXWoh hXU03P/q7n3exmUZpvBHT9Uu4VKVttdYeOwVselaEr08/jC5UlEYFzRqlEM9e7VE8V8OsA Kfr65mPOYIwhkw1qiJeZOOVmPaRJPMUbfoG+yqpTsydV8FXltXfl8mtFMdhZGA== 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 X-MS-Reactions: disallow Message-Id: <20250923174007.84121-2-proxmox8914@herold.me> In-Reply-To: <20250923174007.84121-1-proxmox8914@herold.me> References: <20250923174007.84121-1-proxmox8914@herold.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy KAM_INFOUSMEBIZ 0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [herold.me,vzdump.pm] Signed-off-by: Constantin Herold --- 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 --===============9119690086376212142== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============9119690086376212142==--