jan-di / docker-database-backup Goto Github PK
View Code? Open in Web Editor NEWDockerized service to backup all running database containers
License: MIT License
Dockerized service to backup all running database containers
License: MIT License
Multi Platform builds are taking multiple hours to complete, see https://github.com/jan-di/docker-database-backup/actions/runs/1403055695 for example.
Hi, thanks for the awesome tool! I've added it to a Docker Compose cluster I'm running - it's great to have automatic backups ๐
I was wondering what you thought of the following feature request:
Add a config option that appends a timestamp to the backup filename. This would allow multiple backups to be written out from a service and remove the need for another tool to rename the files before archiving them.
I think it makes most sense for the config option to be at the database level rather than global, so it could be set for some databases and not others.
e.g.
# Minimal Docker Compose usage example
version: '3.8'
services:
db-backup: # backup service
image: ghcr.io/jan-di/database-backup
environment:
- TZ=Europe/Berlin
- SCHEDULE=600
volumes:
- /var/run/docker.sock:/var/run/docker.sock
database1: # well known database image
image: mariadb:latest
environment:
- MYSQL_ROOT_PASSWORD=secret-password
labels:
- jan-di.database-backup.enable=true
- jan-di.database-backup.dump_timestamp=true <-- This bit is new.
Output;
/dump/database1_2021-10-30T14:35:40+00:00.sql
(ISO 8601)Would this be something that you'd be interested in adding to this tool? If so I'm happy to have a hack at implementing it (but don't want to step on your toes!)
Create .sql.gz files, optionally.
Also print uncompressed and compress file size in logs.
Webhook to send a JSON payload with details about each backup cycle to a defined url.
Add options to control the behaviour of how many files should be kept. Currently only one files is kept.
Requires #13
Hey, i heard that you implement feature requests very quickly! I would like to have support for InfluxDB. If you need help, have a look here, someone has already tried it. Thanks a lot! Feature complete, testing and documentation until the weekend is fast enough ๐๐ป
E.g. enable=instance1 instead of enable=true
Comma seperated list for multiple instances
When a database container is started shortly before the backup cycle runs, the connection may fail due to the database is not ready. When the backup service uses healthcheck connections, this means that there are fail messages.
There should be a gracetime parameter. If the backup fails in this time after the container start, its ignored.
Restrict character set for custom dump names to the same set docker uses for container names, to prevent strange behaviour on handling the files.
[a-zA-Z0-9][a-zA-Z0-9_.-]
See also
https://stackoverflow.com/questions/42642561/docker-restrictions-regarding-naming-container
https://github.com/moby/moby/blob/be97c66708c24727836a22247319ff2943d91a03/daemon/names/names.go
..for times in log messages
The container cannot determine its own id, to connect with the docker network.
See more details here: https://stackoverflow.com/questions/68816329/how-to-get-docker-container-id-from-within-the-container-with-cgroup-v2
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.