From c91403c61c287c7d1250b3308d0e6690d39e60d2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 18 Feb 2022 13:05:20 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hosts/vidhar/borg/copy.py') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index d8d19a86..f6d100be 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -131,14 +131,15 @@ def copy_archive(src_repo_path, dst_repo_path, entry): (chroot / bindMount).mkdir(parents=True,exist_ok=True) # print(*['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], file=stderr) subprocess.run(['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], check=True) + os.chroot(chroot) + os.chdir('/') try: os.unlink('/etc/fuse.conf') except FileNotFoundError: pass + pathlib.Path('/etc/fuse.conf').parent.mkdir(parents=True,exist_ok=True) with open('/etc/fuse.conf', 'w') as fuse_conf: fuse_conf.write('user_allow_other\nmount_max = 1000\n') - os.chroot(chroot) - os.chdir('/') dir = pathlib.Path('/borg') dir.mkdir(parents=True,exist_ok=True,mode=0o0750) os.chown(dir, borg_pwd.pw_uid, borg_pwd.pw_gid) -- cgit v1.2.3