[SOLVED] VZdump and the infinite exclude-path error

diaolin

Active Member
Jul 7, 2008
220
0
36
Trentino Italy
Found the bug, i hope that Dietmar will be so kind to include the solution.

/usr/share/perl5/PVE/API2/VZDump.pm

This code says that the exclude-path is ALWAYS read from command-line
and despite each line in /etc/vzdump.conf will be skipped

Code:
# exclude-path list need to be 0 separated
my @expaths = split(/\0/, $param->{'exclude-path'} || '');
$param->{'exclude-path'} = [ @expaths ];
the solution?
this one:

Code:
# exclude-path list need to be 0 separated
if (exists($param->{'exclude-path'})) {
    my @expaths = split(/\0/, $param->{'exclude-path'} || '');
    $param->{'exclude-path'} = [ @expaths ];
}
when the cmdline does not contain exclude-path the conf will be read

of course even the other parameters should be verified...
for example mailto and so on

/etc/vzdump.conf

exclude-path: /usr/.+ /sbin/.+ /var/.+

And now it works


Diaolin


(Here the solution for 1.* versions)

/usr/share/perl5/PVE/VZDump.pm

Change:

Code:
foreach my $k (keys %$defaults) {
if ($k eq 'dumpdir' || $k eq 'storage') {
               $opts->{$k} = $defaults->{$k} if !defined ($opts->{dumpdir}) &&
                !defined ($opts->{storage});
    } else {
              $opts->{$k} = $defaults->{$k} if !defined ($opts->{$k});
   }
}

in

Code:
foreach my $k (keys %$defaults) {
     if ($k eq 'dumpdir' || $k eq 'storage') {
            $opts->{$k} = $defaults->{$k} if !defined ($opts->{dumpdir}) &&
                !defined ($opts->{storage});
        } else {
      if (!defined ($opts->{$k}) or !$opts->{$k}) { $opts->{$k} = $defaults->{$k}; }
        }
 }
 
Last edited:

diaolin

Active Member
Jul 7, 2008
220
0
36
Trentino Italy
pay attention, we did a fix to the problem of exclude-path but there are many others
just follow the solution.

The idea behind your code is ok but it states that if you find a single parameter on cmdline
all parameters are overwritten, with my little hint this happens only for the passed param.

Diaolin
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!