Public | Automated Build

Last pushed: 15 days ago
Short Description
backup all DBs in a mysql server
Full Description

Regular backup an DB found in the mysql linked as "mysql" to the voloume /var/dbdumps.


You have to:

  • run the container dsteinkopf/backup-all-mysql`
  • create a link called mysql to you db to be backed up.
  • Create a volume called /var/dbdumps.


  • Interval may be set via environment BACKUP_INTERVAL (in seconds).
  • Use BACKUP_FIRSTDELAY to delay the very first backup to be done by n seconds. The idea behind this is to prevent existing backups to be overwritten in case of problems. So you can manually kill everything an try again within this delay.
  • MYSQLDUMP_ADD_OPTS (default = ""): More options to be added to mysqldump.
  • MYSQL_CONNECTION_PARAMS (default = ""): More mysql option to add to any mysql command (incl. mysqldump)
  • MYSQL_HOST (default = "mysql"): Hostname (or IP) of mysql database.
  • MYSQL_USER (default = "root"): Username to connect to mysql database.


For an easy monitoring of successful backup an error file /var/dbdumps/errorslastrun.log is created (in volume /var/dbddumps. This file contains errors if there were any - it is empty if everything was ok.

So to monitor correct backup you should

  • check that errorslastrun.log is empty.
  • chat that errorslastrun.log is touched (modification date changed) regularly (see env BACKUP_INTERVAL).

Usage example

In docker-compose.yml:


  image: dsteinkopf/backup-all-mysql:latest
    - mysql
  restart: always
    - /opt/dockervolumes/wordpress/mysql-backup:/var/dbdumps
    - /etc/localtime:/etc/localtime
    - /etc/timezone:/etc/timezone

-> for example found in my Zabbix Setup (German language)

Docker Pull Command
Source Repository