This commit is contained in:
John Lancaster
2024-02-19 23:10:02 -06:00
parent 3c89fe22bc
commit b368cede93
6 changed files with 153 additions and 35 deletions

View File

@@ -7,6 +7,10 @@ import click
import docker
import restic
from docker.models.containers import Container
from rich import print
from rich.console import Console
console = Console()
client = docker.from_env()
@@ -48,13 +52,12 @@ def main(src: Path, docker_stop: str = None):
else:
cons = set()
pw_file = Path('/run/secrets/restic-pw').resolve()
restic.password_file = pw_file.as_posix()
restic.backup(
paths=[''],
dry_run=True
)
with console.status(f'Running backup'):
backup_result = restic.backup(
paths=[src],
dry_run=True
)
print(backup_result)
print(f'{len(restic.snapshots())} snapshots found in the repo')