mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-09-29 07:05:24 +00:00
Cleanup
This commit is contained in:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user