]> git.proxmox.com Git - pmg-api.git/commitdiff
fix #3154: backup: add 'include-statistics' to pbs
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 24 Feb 2021 18:30:59 +0000 (19:30 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 25 Feb 2021 09:36:51 +0000 (10:36 +0100)
This patch addresses part of #3154 - by adding the parameter
'include-statistics' for each remote in /etc/pmg/pbs/pbs.conf.

The other part (actively asking the user whether to include it) is GUI
only, since the API already has the paramter for backup calls.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/API2/PBS/Job.pm
src/PMG/PBSConfig.pm

index b2187797d07de7f82668f8a1f555700c13337a47..23874225b04a615391ed4b4e21b57e7a1cb61fa3 100644 (file)
@@ -291,7 +291,7 @@ __PACKAGE__->register_method ({
        die "PBS remote '$remote' does not exist\n" if !$remote_config;
        die "PBS remote '$remote' is disabled\n" if $remote_config->{disable};
 
-       $param->{statistic} //= 1;
+       $param->{statistic} //= $remote_config->{'include-statistics'} // 1;
 
        my $pbs = PVE::PBSClient->new($remote_config, $remote, $conf->{secret_dir});
        my $backup_dir = "/var/lib/pmg/backup/current";
index 2d80e78230d050df54c5954ad328daf986b0c499..29cff220d1e339e4215b20ed8134193897a9363a 100644 (file)
@@ -90,6 +90,11 @@ sub properties {
            description => "Username or API token ID on the Proxmox Backup Server"
        }),
        fingerprint => get_standard_option('fingerprint-sha256'),
+       'include-statistics' => {
+           description => "Include statistics in scheduled backups",
+           type => 'boolean',
+           optional => 1,
+       },
        %prune_properties,
     };
 }
@@ -102,6 +107,7 @@ sub options {
        username => { optional => 1 },
        password => { optional => 1 },
        fingerprint => { optional => 1 },
+       'include-statistics' => { optional => 1 },
        'keep-last' => { optional => 1 },
        'keep-hourly' =>  { optional => 1 },
        'keep-daily' => { optional => 1 },