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.