From 7dc7b77f6c3bd18aceffe166c5759ed33718a96b Mon Sep 17 00:00:00 2001 From: Jackson Date: Thu, 20 Nov 2025 16:29:20 +0100 Subject: [PATCH] static btrfs snapshot paths i don't know the implications of this change, except for maybe concurrent borgmatic processes --- borgmatic/hooks/data_source/btrfs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/borgmatic/hooks/data_source/btrfs.py b/borgmatic/hooks/data_source/btrfs.py index 0fd758ae..d98fbdd4 100644 --- a/borgmatic/hooks/data_source/btrfs.py +++ b/borgmatic/hooks/data_source/btrfs.py @@ -180,7 +180,7 @@ def get_subvolumes(btrfs_command, patterns): return tuple(sorted(subvolumes, key=lambda subvolume: subvolume.path)) -BORGMATIC_SNAPSHOT_PREFIX = '.borgmatic-snapshot-' +BORGMATIC_SNAPSHOT_PREFIX = '.borgmatic-snapshot' def make_snapshot_path(subvolume_path): @@ -189,7 +189,7 @@ def make_snapshot_path(subvolume_path): ''' return os.path.join( subvolume_path, - f'{BORGMATIC_SNAPSHOT_PREFIX}{os.getpid()}', + f'{BORGMATIC_SNAPSHOT_PREFIX}', # Included so that the snapshot ends up in the Borg archive at the "original" subvolume path. ) + subvolume_path.rstrip(os.path.sep) @@ -244,7 +244,7 @@ def make_borg_snapshot_pattern(subvolume_path, pattern): rewritten_path = initial_caret + os.path.join( subvolume_path, - f'{BORGMATIC_SNAPSHOT_PREFIX}{os.getpid()}', + f'{BORGMATIC_SNAPSHOT_PREFIX}', # Use the Borg 1.4+ "slashdot" hack to prevent the snapshot path prefix from getting # included in the archive—but only if there's not already a slashdot hack present in the # pattern.