selim13 / docker-automysqlbackup Goto Github PK
View Code? Open in Web Editor NEWA lightweight image for creating and managing scheduled MySQL backups
License: GNU General Public License v2.0
A lightweight image for creating and managing scheduled MySQL backups
License: GNU General Public License v2.0
Hello,
is it possible for you to add support for custom / bespoke ports please as the SQL service we use, doesn't run on the default port.
Tom
Using the container with mysql 8 I get following error:
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: Error loading shared library /usr/lib/mysql/plugin/caching_sha2_password.so: No such file or directory
I have a problem with the rights of the backuped files. My dockers run as docker with group users rwxr.x.r.x , but docker-automysqlbackup puts the backuped databases as root:root rw...... so when i try to backup with Duplicati it is not possible. Is there a way to solve this from the docker?
Running this against a MariaDB 10.4.8 I get the error in the subject and the backup of the mysql database does not contain any tables.
mysqlbackup:
image: selim13/automysqlbackup:2.6-6-debian
volumes:
- "mariadb-backup:/backup"
environment:
USERNAME: root
PASSWORD: "..."
DBHOST: cloudserver_db
DBEXCLUDE: "performance_schema information_schema"
CRON_SCHEDULE: "22 22 * * *"
depends_on:
- db
# docker-compose exec mysqlbackup automysqlbackup
mysql: [Warning] Using a password on the command line interface can be insecure.
======================================================================
AutoMySQLBackup VER 2.5
http://sourceforge.net/projects/automysqlbackup/
Backup of Database Server - cloudserver_db
======================================================================
Backup Start Time Wed Oct 2 21:08:36 UTC 2019
======================================================================
Daily Backup of Database ( mysql )
Rotating last weeks Backup...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1556: You can't use locks with log tables when using LOCK TABLES
Backup Information for /backup/daily/mysql/mysql_2019-10-02_21h08m.Wednesday.sql
compressed uncompressed ratio uncompressed_name
535 1088 56.0% /backup/daily/mysql/mysql_2019-10-02_21h08m.Wednesday.sql
The dump contains just a bunch of comments and then
--
-- Current Database: `mysql`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `mysql`;
Other databases are dumped just fine. Changes between 2.6-6-debian and latest don't seem to affect anything relevant.
Thanks
The readme says "removed error logs mailing code"
What is an alternative to receive notifications about errors? Is it somehow possible to call a webservice after error?
I have a problem, might be something simple.
I'm using docker-compose like below (i'm not writing all the input/output since i have multiple files/containers etc). The mysqlbackup container works fine, i can use:
docker exec -it mysqlbackup sh
and run automysqlbackup manually - but the cron jobs or even starting `docker-compose up -d" without CRON_SCHEDULE specified doesn't do anything for me. Thanks for any input.
mysqlbackup:
container_name: mysqlbackup
image: selim13/automysqlbackup
volumes:
- "mysqlbackup-data:/backup"
environment:
- USERNAME=user
- PASSWORD=password
- DBHOST=typo3_db
- CRON_SCHEDULE="0 * * * *"
depends_on:
- typo3_db
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3200d1e77a3d selim13/automysqlbackup "start.sh" 6 minutes ago Up 6 minutes mysqlbackup
docker logs mysqlbackup gives:
2017/10/06 22:24:07 Running version:
2017/10/06 22:24:07 new cron: 0 "0 * * * *"
2017/10/06 22:24:07 Opening port 18080 for health checking
I pulled this image and ran it. I backed up the first table of the database and quit.
I pulled image selim13/automysqlbackup:2.6-4-debian and it seems to be working properly.
I only bring this up because your docker-compose example has selim13/automysqlbackup:2.6-3-debian
In AutoMySQL backup, there is retention preferences, could you include them in this container please?
`
Set rotation of daily backups. VALUE*24hours
If you want to keep only today's backups, you could choose 1,
i.e. everything older than 24hours will be removed.
CONFIG_rotation_daily=6
Set rotation for weekly backups. VALUE*24hours
CONFIG_rotation_weekly=35
Set rotation for monthly backups. VALUE*24hours
CONFIG_rotation_monthly=150
`
Starting gives:
/usr/local/bin/start.sh: 13: /usr/local/bin/start.sh: Bad substitution
Pinned this down to usage of #!/bin/sh instead of #!/bin/bash since sh is now symlinked to dash. Please change the first line to #!/bin/bash.
If the host machine is asleep, what is the state of the container? Is it suspended, or can cron still execute at a given clock time? I would like to run this when I'm not actively using the machine but when I'm not using it, it goes to sleep. Thanks.
installed it as docker compose using the following info
automysqlbackup:
image: selim13/automysqlbackup
container_name: automysqlbackup
restart: unless-stopped
environment:
- PGID=${PGID}
- PUID=${PUID}
- TZ=${TZ}
volumes:
- ${DOCKERCONFDIR}/automysqlbackup:/backup
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
environment:
USERNAME: username
PASSWORD: "password"
DBHOST: mariadb
DBPORT: 3306
CRON_SCHEDULE: '*/15 * * * *'
depends_on:
- mariadb
it startup without any errors as seen in the log
2019-01-27T12:13:03.631221633Z 2019/01/27 13:13:03 Running version:
2019-01-27T12:13:03.631254193Z 2019/01/27 13:13:03 new cron: 0 */15 * * * *
2019-01-27T12:13:03.631375409Z 2019/01/27 13:13:03 Opening port 18080 for health checking
2019-01-27T12:15:00.002352370Z 2019/01/27 13:15:00 13 cmd: automysqlbackup
2019-01-27T12:15:00.039995182Z 2019/01/27 13:15:00 13: ======================================================================
2019-01-27T12:15:00.040023246Z AutoMySQLBackup VER 2.5
2019-01-27T12:15:00.040043647Z http://sourceforge.net/projects/automysqlbackup/
2019-01-27T12:15:00.040049210Z
2019-01-27T12:15:00.040053320Z Backup of Database Server - mariadb
2019-01-27T12:15:00.040057604Z ======================================================================
2019-01-27T12:15:00.041068087Z 2019/01/27 13:15:00 13: Backup Start Time Sun Jan 27 13:15:00 CET 2019
2019-01-27T12:15:00.041081012Z ======================================================================
2019-01-27T12:15:00.041567320Z 2019/01/27 13:15:00 13: Backup End Sun Jan 27 13:15:00 CET 2019
2019-01-27T12:15:00.041577601Z ======================================================================
2019-01-27T12:15:00.041582569Z Total disk space used for backup storage..
2019-01-27T12:15:00.041586882Z Size - Location
2019-01-27T12:15:00.045698045Z 2019/01/27 13:15:00 13: 16K /backup
2019-01-27T12:15:00.045712103Z
2019-01-27T12:15:00.045715605Z ======================================================================
2019-01-27T12:15:00.045718670Z If you find AutoMySQLBackup valuable please make a donation at
2019-01-27T12:15:00.045721590Z 2019/01/27 13:15:00 13: http://sourceforge.net/project/project_donations.php?group_id=101066
2019-01-27T12:15:00.045724504Z ======================================================================
it has created the folders where the backup should happen.
but nothing is getting back-upped.
How to start selim13/automysqlbackup as a daemon?
I am new in Docker.
This works fine but requires opened terminal:
sudo docker run
--name automysqlbackup
--network my-network
-v '/var/xxxxxxxx/backup/docker:/backup'
-e DBHOST=mariadb
-e DBNAMES=all
-e USERNAME=root
-e PASSWORD=xxxxxxxx
-e DBNAMES=all
-e CRON_SCHEDULE="10 06 * * *"
selim13/automysqlbackup:2.6-7-debian
I tried to start it as daemon (-d --restart unless-stopped) but it doesn't work unfortunatelly:
sudo docker run
--name automysqlbackup
--network my-network
-v '/var/xxxxxxxx/backup/docker:/backup'
-e DBHOST=mariadb
-e DBNAMES=all
-e USERNAME=root
-e PASSWORD=xxxxxxxx
-e DBNAMES=all
-e CRON_SCHEDULE="10 06 * * *"
-d --restart unless-stopped
selim13/automysqlbackup:2.6-7-debian
What do I wrong? Thanks
So the image is uptodate with all packages. Github Actions can be used for free on public repositories
Sometimes we would like to backup only chosen databases and tables.
Mysqldump supports the option --ignore-table and the current image also supports to exclude databases.
Hello,
After a quick review, I find a typo on an image name the correct name is 2.6-9-mysql57
Hi, do you plan to create release tags for this project?
Hi,
WIll be great to have the ability to control these config values:
CONFIG_do_monthly
CONFIG_do_weekly
So that you can enable only weekly backups without monthly etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.