db-backup

Run scheduled backups for various databases in a single Docker container. Customize jobs with compression, encryption, and store them locally, on S3, or Azure.

This Docker container provides a versatile solution for automating database backups. It supports a wide range of database servers and offers extensive customization to fit various workflows. You can configure multiple backup jobs, each with its own schedule, destination, and specific settings.

Key capabilities include:

  • Broad Database Support: Backs up CouchDB, InfluxDB, MySQL/MariaDB, Microsoft SQL, MongoDB, Postgres, and Redis servers.
  • Flexible Storage Destinations: Save backups to the local filesystem, S3-compatible services (like AWS S3 or Minio), and Azure Blob Storage.
  • Advanced Scheduling: Define backup jobs to run at specific times, at set intervals, or using cron expressions. You can also set blackout periods to avoid backups during peak hours.
  • Powerful Customization: Choose from multiple compression (GZ, BZ, XZ, ZSTD) and encryption (passphrase or public key) options. Generate MD5 or SHA1 checksums for verification.
  • Notifications and Hooks: Receive notifications on job failure via email, Matrix, Mattermost, and more. Use pre and post-backup hooks to execute custom scripts.
  • Easy Restoration: A companion script is included to help guide you through the process of restoring a database from a backup file.

Directory Structure

db-backup
backups
.env
docker-compose.yml

docker-compose.yml

services:
  db-backup:
    image: tiredofit/db-backup:latest
    container_name: db-backup
    restart: unless-stopped
    volumes:
      - ./backups:/backup
    environment:
      - DB_TYPE=mysql
      - DB_HOST=db
      - DB_NAME=my_database
      - DB_USER=${DB_USER}
      - DB_PASS=${DB_PASS}
      - DB_DUMP_FREQ=1440
      - DB_DUMP_BEGIN=0000
      - DB_CLEANUP_TIME=8640
      - COMPRESSION=ZSTD
      - MD5=TRUE
      - CONTAINER_ENABLE_MONITORING=FALSE

.env

DB_USER=root
DB_PASS=your_super_secret_database_password
Categories:

Share:

Ad
Favicon

 

  
 

Similar to db-backup

Favicon

 

  
  
Favicon

 

  
  
Favicon