summaryrefslogtreecommitdiff
path: root/hosts/vidhar/borg/copy.py
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vidhar/borg/copy.py')
-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 d4edb09d..e82c2286 100755
--- a/hosts/vidhar/borg/copy.py
+++ b/hosts/vidhar/borg/copy.py
@@ -243,10 +243,11 @@ def main():
243 signal.signal(signal.SIGTERM, sigterm) 243 signal.signal(signal.SIGTERM, sigterm)
244 244
245 if 'CREDENTIALS_DIRECTORY' in os.environ: 245 if 'CREDENTIALS_DIRECTORY' in os.environ:
246 def do_chown(path):
247 os.chown(pathlib.Path(root) / pathlib.Path(path), borg_pwd.pw_uid, borg_pwd.pw_gid)
248 do_chown(os.environ['CREDENTIALS_DIRECTORY'])
249
246 for root, dirs, files in os.walk(os.environ['CREDENTIALS_DIRECTORY']): 250 for root, dirs, files in os.walk(os.environ['CREDENTIALS_DIRECTORY']):
247 def do_chown(path):
248 os.chown(pathlib.Path(root) / pathlib.Path(path), borg_pwd.pw_uid, borg_pwd.pw_gid)
249
250 for dir in dirs: 251 for dir in dirs:
251 do_chown(dir) 252 do_chown(dir)
252 for file in files: 253 for file in files: