[pve-devel] [PATCH pve-container 1/2] config: backup: add PBS change detection mode

Christian Ebner c.ebner at proxmox.com
Wed Nov 15 16:59:10 CET 2023


Adds the config option to switch from regular to metadata based change
detection mode when using PBS as backend.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 src/PVE/LXC/Config.pm | 7 +++++++
 src/PVE/VZDump/LXC.pm | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 56e1f10..687d3bf 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -612,6 +612,13 @@ my $confdesc = {
 	description => "Try to be more verbose. For now this only enables debug log-level on start.",
 	default => 0,
     },
+    pbs_change_detection_mode => {
+	optional => 1,
+	type => 'string',
+	enum => ['data', 'metadata'],
+	description => "File change detection mode used for PBS backups.",
+	default => 'data',
+    },
 };
 
 my $valid_lxc_conf_keys = {
diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index c68a06f..d3aa57d 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -119,6 +119,8 @@ sub prepare {
     my $exclude_dirs = $task->{exclude_dirs} = [];
 
     $task->{hostname} = $conf->{'hostname'} || "CT$vmid";
+    $task->{pbs_change_detection_mode} = $conf->{'pbs_change_detection_mode'}
+	if $conf->{'pbs_change_detection_mode'};
 
     my ($id_map, $rootuid, $rootgid) = PVE::LXC::parse_id_maps($conf);
     $task->{userns_cmd} = PVE::LXC::userns_command($id_map);
@@ -395,6 +397,9 @@ sub archive {
 	push @$param, '--backup-id', $vmid;
 	push @$param, '--backup-time', $task->{backup_time};
 
+	push @$param, '--change-detection-mode', $task->{pbs_change_detection_mode}
+	    if $task->{pbs_change_detection_mode};
+
 	if (my $entries_max = $opts->{"performance"}->{"pbs-entries-max"}) {
 	    push $param->@*, '--entries-max', $entries_max;
 	    $self->loginfo(
-- 
2.39.2






More information about the pve-devel mailing list