Skip to content

manager

Main module which manages the backups and restore functions

Classes:

Attributes

Classes

BackupManager

BackupManager(
    compression: CompressionAlgorithm = "plain",
    backup_dir: Path = DEFAULT_BACKUP_DIR,
    use_timestamp: bool = False,
    use_secret: bool = False,
    webhook_url: str = "",
    project_name: str = "",
    global_mode: bool = False,
)

Manages the backups and restore functions

Methods:

Attributes:

Attributes

BACKUP_PROVIDERS class-attribute instance-attribute
BACKUP_PROVIDERS: list[type[BackupProviderBase]] = (
    BACKUP_PROVIDERS
)
compression instance-attribute
backup_dir instance-attribute
backup_dir = backup_dir
use_timestamp instance-attribute
use_timestamp = use_timestamp
strtimestamp instance-attribute
strtimestamp: str = (
    strftime("%Y%m%d%H%M%S") if use_timestamp else ""
)
use_secret instance-attribute
use_secret = use_secret
webhook_url instance-attribute
webhook_url = webhook_url
global_mode instance-attribute
global_mode = global_mode
porject_name instance-attribute
porject_name = project_name
docker_client instance-attribute
docker_client = from_env()

Functions

get_temp_backup_file_name
get_temp_backup_file_name(
    provider: BackupProviderBase,
) -> str
get_backup_filename
get_backup_filename(
    container: Container, provider: BackupProviderBase
) -> Path
get_my_container_id
get_my_container_id()
get_compose_project
get_compose_project()
get_enabled_containers
get_enabled_containers() -> Iterable[Container]
get_backup_provider
get_backup_provider(
    container: Container,
) -> Optional[BackupProviderBase]
backup
backup(now: datetime) -> int
restore
restore(target: str, restore_file: Path) -> int

Functions