summaryrefslogtreecommitdiff
path: root/hosts/vidhar/borg
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-02-18 12:05:42 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-02-18 12:05:42 +0100
commitba063fb1e705997143191cf2aa97ed8cb8a86078 (patch)
tree7ec6e5da345bddb43f64e5b273ae8e39be0da377 /hosts/vidhar/borg
parent1c1e6fe2922c7c07822e79af6deec9cd0beeea58 (diff)
downloadnixos-ba063fb1e705997143191cf2aa97ed8cb8a86078.tar
nixos-ba063fb1e705997143191cf2aa97ed8cb8a86078.tar.gz
nixos-ba063fb1e705997143191cf2aa97ed8cb8a86078.tar.bz2
nixos-ba063fb1e705997143191cf2aa97ed8cb8a86078.tar.xz
nixos-ba063fb1e705997143191cf2aa97ed8cb8a86078.zip
vidhar: ...
Diffstat (limited to 'hosts/vidhar/borg')
-rwxr-xr-xhosts/vidhar/borg/copy.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py
index e82c2286..91c65e1e 100755
--- a/hosts/vidhar/borg/copy.py
+++ b/hosts/vidhar/borg/copy.py
@@ -244,14 +244,15 @@ def main():
244 244
245 if 'CREDENTIALS_DIRECTORY' in os.environ: 245 if 'CREDENTIALS_DIRECTORY' in os.environ:
246 def do_chown(path): 246 def do_chown(path):
247 os.chown(pathlib.Path(root) / pathlib.Path(path), borg_pwd.pw_uid, borg_pwd.pw_gid) 247 os.chown(path, borg_pwd.pw_uid, borg_pwd.pw_gid)
248 do_chown(os.environ['CREDENTIALS_DIRECTORY']) 248 do_chown(os.environ['CREDENTIALS_DIRECTORY'])
249 249
250 for root, dirs, files in os.walk(os.environ['CREDENTIALS_DIRECTORY']): 250 for root, dirs, files in os.walk(os.environ['CREDENTIALS_DIRECTORY']):
251 root_path = pathlib.Path(root)
251 for dir in dirs: 252 for dir in dirs:
252 do_chown(dir) 253 do_chown(root_path / pathlib.Path(dir))
253 for file in files: 254 for file in files:
254 do_chown(file) 255 do_chown(root_path / pathlib.Path(file))
255 256
256 if "::" in args.source: 257 if "::" in args.source:
257 (src_repo_path, _, src_archive) = args.source.partition("::") 258 (src_repo_path, _, src_archive) = args.source.partition("::")