Additional Setup ‐ Database ‐ Automated backup - MarechJ/hll_rcon_tool GitHub Wiki

🧭 You are here : Wiki home / Additional Setup / Database - Automated backup


This relies on prodrigestivill's Github repository.

PostgreSQL Backup via pgbackup Docker Container

The following example uses a Docker container to dump the CRCON PostgreSQL database to a folder, which can then be backed up manually or via a server backup or snapshot from your server provider.

Important notes

  • You can create a new Docker container for this function or you can add it to your CRCON compose.yaml
  • Ensure this service definition includes the common network, so it can connect to the CRCON postgres Docker container.

Add this to your compose.yaml

pgbackups:
    image: prodrigestivill/postgres-backup-local
    restart: always
    # user: postgres:postgres # Optional: see below
    volumes:
      - ./pgbackups:/backups
    networks:
      - common
    links:
      - postgres
    depends_on:
      - postgres
    environment:
      - POSTGRES_PASSWORD=${HLL_DB_PASSWORD}
      - POSTGRES_USER=${HLL_DB_USER}
      - POSTGRES_DB=${HLL_DB_NAME}
      - HLL_DB_HOST=${HLL_DB_HOST}
      - POSTGRES_EXTRA_OPTS=-Z6 --schema=public --blobs
      - SCHEDULE=@daily
      - BACKUP_KEEP_DAYS=7
      - BACKUP_KEEP_WEEKS=4
      - BACKUP_KEEP_MONTHS=6
      - HEALTHCHECK_PORT=8080