summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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("::")