backups: Create folder if needed during setup

Signed-off-by: James Valleroy's avatarJames Valleroy <jvalleroy@mailbox.org>
parent 102ef0b5
Pipeline #19227 passed with stages
in 12 minutes and 13 seconds
......@@ -83,6 +83,10 @@ def subcommand_setup(_):
try:
subprocess.run(['borg', 'info', REPOSITORY], check=True)
except:
path = os.path.dirname(REPOSITORY)
if not os.path.exists(path):
os.makedirs(path)
subprocess.run(['borg', 'init', '--encryption', 'none', REPOSITORY])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment