public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-container 1/2] config: backup: add PBS change detection mode
Date: Wed, 15 Nov 2023 16:59:10 +0100	[thread overview]
Message-ID: <20231115155911.285968-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20231115155911.285968-1-c.ebner@proxmox.com>

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@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





  reply	other threads:[~2023-11-15 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 15:59 [pve-devel] [PATCH pve-container pve-manager 0/2] add config option for metadata based PBS backup Christian Ebner
2023-11-15 15:59 ` Christian Ebner [this message]
2023-11-15 15:59 ` [pve-devel] [PATCH pve-manager 2/2] lxc: options: add PBS change detecion mode selector Christian Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231115155911.285968-2-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal