adding some tools to assist in borg servers

This commit is contained in:
brent s 2019-08-15 07:01:58 -04:00
parent bcbf659a8a
commit 4f1b311a79
2 changed files with 134 additions and 0 deletions

17
tools/borg-restricted.py Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python3
import os
import pwd
import subprocess
cur_user = os.geteuid()
homedir = pwd.getpwuid(cur_user).pw_dir
borg_bin = '/usr/bin/borg'
os.chdir(homedir)
subprocess.run([borg_bin,
'serve',
'--restrict-to-path',
homedir])