plugin: subdir files: backup: don't match for vmid against the full path
Only match against the file name to avoid false positives with directory names containing "-$vmid-". Found while trying to debug/reproduce a forum thread[0], but the path there should not be affected by this... [0]: https://forum.proxmox.com/threads/vzdump-removing-too-many-backups.87072/ Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
c241c2159d
commit
edb92f707a
@ -1034,11 +1034,13 @@ my $get_subdir_files = sub {
|
|||||||
$info = { volid => "$sid:vztmpl/$1", format => "t$2" };
|
$info = { volid => "$sid:vztmpl/$1", format => "t$2" };
|
||||||
|
|
||||||
} elsif ($tt eq 'backup') {
|
} elsif ($tt eq 'backup') {
|
||||||
next if defined($vmid) && $fn !~ m/\S+-$vmid-\S+/;
|
|
||||||
next if $fn !~ m!/([^/]+\.(tgz|(?:(?:tar|vma)(?:\.(${\COMPRESSOR_RE}))?)))$!;
|
next if $fn !~ m!/([^/]+\.(tgz|(?:(?:tar|vma)(?:\.(${\COMPRESSOR_RE}))?)))$!;
|
||||||
my $original = $fn;
|
my $original = $fn;
|
||||||
my $format = $2;
|
my $format = $2;
|
||||||
$fn = $1;
|
$fn = $1;
|
||||||
|
|
||||||
|
next if defined($vmid) && $fn !~ m/\S+-$vmid-\S+/;
|
||||||
|
|
||||||
$info = { volid => "$sid:backup/$fn", format => $format };
|
$info = { volid => "$sid:backup/$fn", format => $format };
|
||||||
|
|
||||||
my $archive_info = eval { PVE::Storage::archive_info($fn) } // {};
|
my $archive_info = eval { PVE::Storage::archive_info($fn) } // {};
|
||||||
|
|||||||
Reference in New Issue
Block a user