Docker AutoMySQLBackup

Run scheduled or one-shot MySQL backups in a lightweight container. Configure daily, weekly, and monthly schedules, compression, and database exclusions.

This is a lightweight Docker image designed to create and manage backups for your MySQL databases. It runs a modified version of the popular AutoMySQLBackup utility, optimized for containerized environments. You can run it for a one-shot backup on demand or configure it to run automatically on a recurring basis using a cron schedule.

The image is highly flexible and can be configured entirely through environment variables. This allows you to tailor the backup process to your specific needs. Key configuration options include:

  • Backup targets: Specify all databases, a list of databases, or even exclude certain databases or tables.
  • Scheduling: Define daily, weekly, and monthly backup rotations, including the specific day for weekly backups.
  • Compression: Choose between gzip or bzip2 for your backup files.
  • Custom scripts: Execute pre-backup and post-backup commands for advanced workflows.
  • Security: Use Docker Secrets to securely pass sensitive credentials like usernames and passwords.

This tool provides a simple yet powerful solution for automating your MySQL backup strategy within a Docker ecosystem.

Directory Structure

docker-automysqlbackup
automysqlbackup
backups
.env
docker-compose.yml

docker-compose.yml

services:
  automysqlbackup:
    image: selim13/automysqlbackup:latest
    container_name: automysqlbackup
    environment:
      - DBHOST=mysql
      - USERNAME=${DB_USERNAME}
      - PASSWORD=${DB_PASSWORD}
      - DBNAMES=all
    volumes:
      - ./backups:/backup
    restart: unless-stopped

.env

DB_USERNAME=root
DB_PASSWORD=your_super_secret_password
Categories:

Share:

Ad
Favicon

 

  
 

Similar to Docker AutoMySQLBackup

Favicon

 

  
  
Favicon

 

  
  
Favicon