Minituff / nautical-backup

A simple Docker volume backup tool.
https://minituff.github.io/nautical-backup/
GNU General Public License v3.0
217 stars 3 forks source link

Labels do not work #305

Open pendraggon87 opened 2 weeks ago

pendraggon87 commented 2 weeks ago

I have configured the backup container to require the use of the nautical-backup.enable label. However, even when I use this label on numerous containers, nautical-backup will skip backing them up.

Minituff commented 2 weeks ago

Hi,

Could you set the log level to TRACE and attach your Nautical config and logs as well as one of the skipped container's config.

Is it skipping all containers? I wonder if it's not detecting the enable label?

pendraggon87 commented 2 weeks ago

I see errors like this in TRACE: DEBUG: paperless-webserver-1 - Source directory '/app/source/paperless-webserver-1' does not exist. Skipping

Minituff commented 2 weeks ago

Ahh okay I think I understand. It seems like the nautical-backup.enable label is working properly. The issue seems to be that the /app/source/paperless-webserver-1 doesn't exist inside Nautical.

Take a look at this example:

services:
  nautical-backup:
    image: minituff/nautical-backup:2 
    container_name: nautical-backup
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /config:/config
      - /path/to/docker/volumes:/app/source  # <---  Source
      - /destination:/app/destination

The most relevant line is this one: - /path/to/docker/volumes:/app/source.

Here we are telling Docker to pass all the files/folders from /path/to/docker/volumes into the Nautical container at the path /app/source.

In your case, can you check to make sure your Source path is mapped correctly? Additionally, the folder paperless-webserver-1 needs to exist inside the Source path so it can be picked up.

pendraggon87 commented 2 weeks ago

Hm. In this case I am using a Windows host for Docker. I am able to mount the docker volume path. However, nautical-backup seems to be looking for the volume to be the same name as the container? e.g. if I have a named volume database, docker then creates the volume authentik_database. Yet nautical-backup is looking for authentik-postgres-1 which is the name of the container.

Minituff commented 2 weeks ago

However, nautical-backup seems to be looking for the volume to be the same name as the container?

Yes, this is the default action, but you have a few options if you don't want to rename the source folders.

  1. Using overrides via a global Environment variable

Here you modify the Nautical config

services:
  nautical-backup:
    image: minituff/nautical-backup:2 
    container_name: nautical-backup
    environment:
      - OVERRIDE_SOURCE_DIR=authentik-postgres-1:authentik_database
  1. Using overrides via a global via a label on each container.

Here you modify the config on each container

services:
  authentic-postgres:
    image: authentic/imagename:latest
    container_name: authentic-something
    labels:
      - nautical-backup.override-source-dir=authentik_database