diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-18 12:03:58 +0100 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-18 12:03:58 +0100 |
| commit | 1c1e6fe2922c7c07822e79af6deec9cd0beeea58 (patch) | |
| tree | c69a37ac26de90c81658003ed7f82dc6373feb99 /hosts/vidhar/borg | |
| parent | a3e887a43aba76997aab033a42358f400e2ef9af (diff) | |
| download | nixos-1c1e6fe2922c7c07822e79af6deec9cd0beeea58.tar nixos-1c1e6fe2922c7c07822e79af6deec9cd0beeea58.tar.gz nixos-1c1e6fe2922c7c07822e79af6deec9cd0beeea58.tar.bz2 nixos-1c1e6fe2922c7c07822e79af6deec9cd0beeea58.tar.xz nixos-1c1e6fe2922c7c07822e79af6deec9cd0beeea58.zip | |
vidhar: ...
Diffstat (limited to 'hosts/vidhar/borg')
| -rwxr-xr-x | hosts/vidhar/borg/copy.py | 7 |
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: |
