summaryrefslogtreecommitdiff
path: root/modules/borgsnap
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-11-02 18:20:24 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-11-02 18:20:24 +0100
commitf563ddece04adfd8d80d4e984405f5c70a6c94f3 (patch)
treefe82abab81c8d33ff19aa657c1617a0befc21637 /modules/borgsnap
parent6bafcb244bd6cd031ac9b65fce8a2a939698ecaa (diff)
downloadnixos-f563ddece04adfd8d80d4e984405f5c70a6c94f3.tar
nixos-f563ddece04adfd8d80d4e984405f5c70a6c94f3.tar.gz
nixos-f563ddece04adfd8d80d4e984405f5c70a6c94f3.tar.bz2
nixos-f563ddece04adfd8d80d4e984405f5c70a6c94f3.tar.xz
nixos-f563ddece04adfd8d80d4e984405f5c70a6c94f3.zip
surtr: borg backup to vidhar
Diffstat (limited to 'modules/borgsnap')
-rw-r--r--modules/borgsnap/borgsnap/borgsnap/__main__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/borgsnap/borgsnap/borgsnap/__main__.py b/modules/borgsnap/borgsnap/borgsnap/__main__.py
index 91144780..ad46a7bf 100644
--- a/modules/borgsnap/borgsnap/borgsnap/__main__.py
+++ b/modules/borgsnap/borgsnap/borgsnap/__main__.py
@@ -246,7 +246,9 @@ def create(*, snapshot, target, archive_prefix, dry_run):
246 env['BORG_FILES_CACHE_SUFFIX'] = basename 246 env['BORG_FILES_CACHE_SUFFIX'] = basename
247 archive_name = _archive_name(snapshot, target, archive_prefix) 247 archive_name = _archive_name(snapshot, target, archive_prefix)
248 target_host, _, target_path = target.rpartition(':') 248 target_host, _, target_path = target.rpartition(':')
249 *parents_init, _ = list(Path(target_path).parents) 249 parents_init = list()
250 if Path(target_path).parents:
251 *parents_init, _ = list(Path(target_path).parents)
250 backup_patterns = [*(map(lambda p: Path('.backup') / f'{target_host}:{p}', [Path(target_path), *parents_init])), Path('.backup') / target_host, Path('.backup')] 252 backup_patterns = [*(map(lambda p: Path('.backup') / f'{target_host}:{p}', [Path(target_path), *parents_init])), Path('.backup') / target_host, Path('.backup')]
251 for pattern_file in backup_patterns: 253 for pattern_file in backup_patterns:
252 if (dir / pattern_file).is_file(): 254 if (dir / pattern_file).is_file():