backups: Create folder if needed during setup

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
James Valleroy 2018-09-17 19:17:19 -04:00 committed by Joseph Nuthalapati
parent 188309fd91
commit 7817111928
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35

View File

@ -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])