This commit is contained in:
Einar Forselv
2019-11-15 14:23:56 +01:00
parent f8d32af313
commit f1738147d6
11 changed files with 60 additions and 33 deletions

View File

@@ -1,7 +1,14 @@
import logging
from subprocess import Popen, PIPE
logger = logging.getLogger(__name__)
def init_repo(repository):
"""
Attempt to initialize the repository.
Doing this after the repository is initialized
"""
run_command([
"restic",
"-r",
@@ -40,6 +47,7 @@ def check(repository):
def run_command(cmd):
logger.info('cmd: %s', ' '.join(cmd))
child = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdoutdata, stderrdata = child.communicate()