mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-10-10 04:10:57 +00:00
Skeleton for commands
This commit is contained in:
9
src/restic_compose_backup/commands/alert.py
Normal file
9
src/restic_compose_backup/commands/alert.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Send an alert"""
|
||||||
|
name = "alert"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Alert!")
|
9
src/restic_compose_backup/commands/backup.py
Normal file
9
src/restic_compose_backup/commands/backup.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Backup a directory"""
|
||||||
|
name = "backup"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Backup!")
|
12
src/restic_compose_backup/commands/base.py
Normal file
12
src/restic_compose_backup/commands/base.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from restic_compose_backup.config import Config
|
||||||
|
|
||||||
|
|
||||||
|
class BaseCommand:
|
||||||
|
"""Base class for all commands"""
|
||||||
|
name = "base"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.config = Config()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
raise NotImplementedError
|
9
src/restic_compose_backup/commands/cleanup.py
Normal file
9
src/restic_compose_backup/commands/cleanup.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Cleanup old snapshots"""
|
||||||
|
name = "cleanup"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Cleanup!")
|
9
src/restic_compose_backup/commands/crontab.py
Normal file
9
src/restic_compose_backup/commands/crontab.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Manage crontab"""
|
||||||
|
name = "crontab"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Crontab!")
|
9
src/restic_compose_backup/commands/snapshots.py
Normal file
9
src/restic_compose_backup/commands/snapshots.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""List snapshots"""
|
||||||
|
name = "snapshots"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Snapshots!")
|
9
src/restic_compose_backup/commands/status.py
Normal file
9
src/restic_compose_backup/commands/status.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Show status"""
|
||||||
|
name = "status"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Status!")
|
9
src/restic_compose_backup/commands/test.py
Normal file
9
src/restic_compose_backup/commands/test.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Test a command"""
|
||||||
|
name = "test"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Test!")
|
9
src/restic_compose_backup/commands/version.py
Normal file
9
src/restic_compose_backup/commands/version.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .base import BaseCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""Show version"""
|
||||||
|
name = "version"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("Version!")
|
Reference in New Issue
Block a user