From 1c1e6fe2922c7c07822e79af6deec9cd0beeea58 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 18 Feb 2022 12:03:58 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hosts/vidhar/borg/copy.py') 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(): signal.signal(signal.SIGTERM, sigterm) if 'CREDENTIALS_DIRECTORY' in os.environ: + def do_chown(path): + os.chown(pathlib.Path(root) / pathlib.Path(path), borg_pwd.pw_uid, borg_pwd.pw_gid) + do_chown(os.environ['CREDENTIALS_DIRECTORY']) + for root, dirs, files in os.walk(os.environ['CREDENTIALS_DIRECTORY']): - def do_chown(path): - os.chown(pathlib.Path(root) / pathlib.Path(path), borg_pwd.pw_uid, borg_pwd.pw_gid) - for dir in dirs: do_chown(dir) for file in files: -- cgit v1.2.3