Files
restic-compose-backup/src/restic_compose_backup/commands/snapshots.py
2023-03-09 01:42:27 +01:00

14 lines
358 B
Python

from .base import BaseCommand
from restic_compose_backup import restic
class Command(BaseCommand):
"""List snapshots"""
name = "snapshots"
def run(self):
"""Display restic snapshots"""
stdout, stderr = restic.snapshots(self.config.repository, last=True)
for line in stdout.decode().split('\n'):
print(line)