Skeleton for commands
This commit is contained in:
parent
47d74a2ef7
commit
5f6b1cd7a3
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Send an alert"""
|
||||
name = "alert"
|
||||
|
||||
def run(self):
|
||||
print("Alert!")
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Backup a directory"""
|
||||
name = "backup"
|
||||
|
||||
def run(self):
|
||||
print("Backup!")
|
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Cleanup old snapshots"""
|
||||
name = "cleanup"
|
||||
|
||||
def run(self):
|
||||
print("Cleanup!")
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Manage crontab"""
|
||||
name = "crontab"
|
||||
|
||||
def run(self):
|
||||
print("Crontab!")
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""List snapshots"""
|
||||
name = "snapshots"
|
||||
|
||||
def run(self):
|
||||
print("Snapshots!")
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Show status"""
|
||||
name = "status"
|
||||
|
||||
def run(self):
|
||||
print("Status!")
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Test a command"""
|
||||
name = "test"
|
||||
|
||||
def run(self):
|
||||
print("Test!")
|
|
@ -0,0 +1,9 @@
|
|||
from .base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Show version"""
|
||||
name = "version"
|
||||
|
||||
def run(self):
|
||||
print("Version!")
|
Loading…
Reference in New Issue