diff --git a/example/compose.yml b/example/compose.yml index c971808..bb126dc 100644 --- a/example/compose.yml +++ b/example/compose.yml @@ -15,6 +15,8 @@ volumes: # === Backups # - backup/restore commands need to write to STDOUT / read from STDIN + # enable backups of this volume (defaults to true) + work.banananet.podman.backup.enable: "true" # container/service to run commands in (takes precedence over .image) # service will ignore .stop if required work.banananet.podman.backup.container: database diff --git a/podman-compose-backup.py b/podman-compose-backup.py index f803cad..bdcd61d 100644 --- a/podman-compose-backup.py +++ b/podman-compose-backup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -# TODO enable disabling volume backup (for example for caches) with further label # TODO implement backup single vol # TODO implement restore single vol # TODO decide upon depends_on and volume mounts which containers must be shut down and which turned on for single volume backup (def) @@ -141,6 +140,7 @@ def parse_bool(val: str | bool) -> bool: @define(kw_only=True) class VolumeBackupConfig: # === Backups + enable: bool = field(converter=parse_bool, default=True) container: Optional[str] = field(default=None) image: str = field(default=DEFAULT_BACKUP_IMAGE) mount_target: str = field(default=DEFAULT_MOUNT_TARGET)