Docker Image for AutoMySQLBackup
A Docker image that runs AutoMySQLBackup on a regular basis and emails out
reports through ssmtp.
docker run \ -v "backup_directory:/data" \ -v "automysqlbackup.conf:/etc/automysqlbackup/automysqlbackup.conf:ro" \ -v "ssh:/home/amb/.ssh" \ -v "ssmtp.conf:/etc/ssmtp/ssmtp.conf" \ -e AMB_SCHEDULE="10 3,15 * * *" \ -e AMB_TARGET="$REMOTE_HOST" \ -e AMB_RUN_ON_STARTUP="no" \ -t \ -d \ aubertg/automysqlbackup-docker
Running this container for the first time
Set up a ssh directory on the host (similar to a normal
user) and mount it as a Docker volume at
/home/amb/.ssh. Make sure the
container has read/write access to it (no
:roat the end of the volume
Start the container.
Attach a terminal to your container.
Run these commands:
su amb ssh $AMB_TARGET
Accept the authenticity of the host if you are connecting for the first
time, and make sure that you successfully get a shell on the remote server.
Close the shell.
Restart the container if you have set `AMB_RUN_ON_STARTUP="yes" and would
like to start the first run of AutoMySQLBackup immediately.
The container requires the following volumes to be attached in order to work
Where the AutoMySQLBackup backup files and logs will be stored.
A ssmtp config file to send emails reports from the Docker container.
Example for Gmail:
# Settings for Gmail SMTP service. mailhub=smtp.gmail.com:587 hostname=smtp.gmail.com:587 UseSTARTTLS=YES FromLineOverride=YES # Gmail account. firstname.lastname@example.org AuthUseremail@example.com AuthPass=mypassword
A configuration file for AutoMySQLBackup. See
in the git repository of this image for an example of configuration file
corresponding to the version of AutoMySQLBackup shipping with this Docker
A persistent ssh directory with files such as
configand a private key that
allows connecting to the remote host.
The container is configurable through the following environment variables:
Numeric uid in the host that should own created files; defaults to 9000.
Numeric gid in the host that should own created files; defaults to 9000.
Timezone; defaults to America/Los_Angeles.
Custom sync schedule; defaults to daily at 1:00am.
yesto trigger a run when the container starts, in addition to the
normal cron schedule.
Copyright (C) 2017 Guillaume Aubert.
The original version of AutoMySQLBackup (v3.0_rc6) is under the GPLv2
license. The modifications to
automysqlbackupin this repository and
corresponding Docker image are accordingly released under the GPLv2 license.
This software is released under the GPLv2 license. See the LICENSE file for
I am providing code in this repository to you under an open source license.
Because this is my personal repository, the license you receive to my code is
from me and not from my employer (Facebook).