From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 30DC1712E3 for ; Wed, 11 May 2022 09:38:13 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 203171830A for ; Wed, 11 May 2022 09:37:43 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 id 8A87E182FE for ; Wed, 11 May 2022 09:37:42 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 50D8843358 for ; Wed, 11 May 2022 09:37:36 +0200 (CEST) Message-ID: <8f5059ca-d288-9cc4-71d4-9c145dde5e0e@proxmox.com> Date: Wed, 11 May 2022 09:37:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: pve-devel@lists.proxmox.com, d.tschlatscher@proxmox.com References: <20220510120937.83344-1-d.tschlatscher@proxmox.com> From: Fabian Ebner In-Reply-To: <20220510120937.83344-1-d.tschlatscher@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.500 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.851 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH storage] Remove the .notes file when a backup is deleted X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2022 07:38:13 -0000 Commit title should include "fixes #3972" Please note that there's also an archive_remove() function in Storage.pm which is called when pruning. That (and I'd say archive_info() too) should be extended to also handle the notes file. Am 10.05.22 um 14:09 schrieb Daniel Tschlatscher: > When a VM or Container was deleted, the .notes file was not removed, Nit: should be "VM or Container backup" > therefore, over time the dump folder would get polluted with notes of > backups that no longer existed. > As backup names contain a timestamp and as the notes cannot be reused > because of this, I think it is safe to just delete them just like we > do with the .log file. >> Signed-off-by: Daniel Tschlatscher > --- > PVE/API2/Storage/Content.pm | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm > index 8ff858d..3f9d77f 100644 > --- a/PVE/API2/Storage/Content.pm > +++ b/PVE/API2/Storage/Content.pm > @@ -457,8 +457,11 @@ __PACKAGE__->register_method ({ > if ($vtype eq 'backup' > && $path =~ /(.*\/vzdump-\w+-\d+-\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2})[^\/]+$/) { It would be nice if we could simply switch to calling archive_remove() here for non-PBS, but that might break interaction with external plugins. But maybe we can at least re-use archive_info() to match the path and get the log and notes file names. > my $logpath = "$1.log"; > + my $notespath = "$path.notes"; > # try to cleanup our backup log file too, if still existing, #318 > unlink($logpath) if -e $logpath; > + # also cleanup the .notes file if it still exists, #3972 > + unlink($notespath) if -e $notespath; > } > }; >