From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6A0881FF38C for ; Fri, 31 May 2024 12:08:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4805A32E11; Fri, 31 May 2024 12:08:30 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 31 May 2024 12:07:53 +0200 Message-Id: <20240531100753.40964-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531100753.40964-1-f.ebner@proxmox.com> References: <20240531100753.40964-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.059 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH docs] backup: warn that tar does not honor exclusion pattern with a trailing slash X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" As reported in the community forum [0], for tar, an exclusion pattern with a trailing slash will not match a folder with that name. For rsync and proxmox-backup-client however, such a pattern will exclude a directory with that name, but not a file. rsync is used for 'suspend' mode backup and tar is used for all non-PBS backups to create the archive. So currently, in the presence of an exclusion pattern with a trailing slash, there is inconsistency between different backup modes (because for 'suspend' mode, rsync will already do the exclusion too) as well as between PBS and non-PBS backups. There doesn't seem to be a straight-forward way to align the behavior for tar with command-line options exactly. The trailing slash can't be removed from the pattern, because that would also match files. Matching with > some/pattern/* > some/pattern/.* rather than > some/pattern/ gets pretty close, which was suggested by Dominik. Just the empty directory is still included. In any case, modifying current behavior would be a breaking change, so actually aligning the exclusion (more closely) is better done in the next major release. Signed-off-by: Fiona Ebner --- vzdump.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vzdump.adoc b/vzdump.adoc index 79d4bbc..3918e9a 100644 --- a/vzdump.adoc +++ b/vzdump.adoc @@ -578,6 +578,12 @@ You can also manually specify (additional) exclude paths, for example: excludes the directory `/tmp/` and any file or directory named `/var/foo`, `/var/foobar`, and so on. +WARNING: For backups to Proxmox Backup Server (PBS) and `suspend` mode backups, +patterns with a trailing slash will match directories, but not files. On the +other hand, for non-PBS `snapshot` mode and `stop` mode backups, patterns with a +trailing slash currently do not match at all, because the `tar` command does not +support that. + Paths that do not start with a `/` are not anchored to the container's root, but will match relative to any subdirectory. For example: -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel