Skip to content

Commit ea689f1

Browse files
foxmoxThomasLamprecht
authored andcommitted
backup: warn that tar does not honor exclusion pattern with a trailing slash
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 <[email protected]>
1 parent 6ef9ff4 commit ea689f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vzdump.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,12 @@ You can also manually specify (additional) exclude paths, for example:
622622
excludes the directory `/tmp/` and any file or directory named `/var/foo`,
623623
`/var/foobar`, and so on.
624624
625+
WARNING: For backups to Proxmox Backup Server (PBS) and `suspend` mode backups,
626+
patterns with a trailing slash will match directories, but not files. On the
627+
other hand, for non-PBS `snapshot` mode and `stop` mode backups, patterns with a
628+
trailing slash currently do not match at all, because the `tar` command does not
629+
support that.
630+
625631
Paths that do not start with a `/` are not anchored to the container's root,
626632
but will match relative to any subdirectory. For example:
627633

0 commit comments

Comments
 (0)