vzdump : skip special:cloudinit section

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Alexandre Derumier 2022-06-22 13:51:58 +02:00 committed by Thomas Lamprecht
parent ae37db2423
commit 31280b4b72

View File

@ -215,17 +215,20 @@ sub assemble {
my $found_snapshot; my $found_snapshot;
my $found_pending; my $found_pending;
my $found_cloudinit;
while (defined (my $line = <$conffd>)) { while (defined (my $line = <$conffd>)) {
next if $line =~ m/^\#vzdump\#/; # just to be sure next if $line =~ m/^\#vzdump\#/; # just to be sure
next if $line =~ m/^\#qmdump\#/; # just to be sure next if $line =~ m/^\#qmdump\#/; # just to be sure
if ($line =~ m/^\[(.*)\]\s*$/) { if ($line =~ m/^\[(.*)\]\s*$/) {
if ($1 =~ m/PENDING/i) { if ($1 =~ m/PENDING/i) {
$found_pending = 1; $found_pending = 1;
} elsif ($1 =~ m/special:cloudinit/) {
$found_cloudinit = 1;
} else { } else {
$found_snapshot = 1; $found_snapshot = 1;
} }
} }
next if $found_snapshot || $found_pending; # skip all snapshots and pending changes config data next if $found_snapshot || $found_pending || $found_cloudinit; # skip all snapshots,pending changes and cloudinit config data
if ($line =~ m/^unused\d+:\s*(\S+)\s*/) { if ($line =~ m/^unused\d+:\s*(\S+)\s*/) {
$self->loginfo("skip unused drive '$1' (not included into backup)"); $self->loginfo("skip unused drive '$1' (not included into backup)");