Docker container to Backup your Mysql & Postgres databases.
BackData is a docker container allowing the backup of your databases in an automated way. The interval is fully customizable via the Cron syntax.
This project is realized in .NET and relies on the Quartz tool for the scheduled jobs.
For the moment, this container only supports MySQL databases.
You must have a database accessible from the BackData container with the right credentials.
When BackData is launched, it makes a backup of all the configured databases. This allows it to check the connections and start from a correct base.
The following directories are used for the configuration and data of the container, they must be persistent.
| Directory | Description |
|---|---|
/app/backup | Backups |
/app/conf | Configuration files |
Warning: If you use environment variables, the functionality is limited. Go to the file-based configuration section for advanced features.
| Env. var | Description | Default |
|---|---|---|
DB_TYPE | Db server type to backup : mysql | mysql |
DB_HOST | Name of db server to backup | |
DB_PORT | Port of db server to backup | 3306 |
DB_NAME | Name of db to backup | |
DB_USER | User of db to backup | |
DB_PASSWORD | Password of db to backup | |
DB_BACKUP_CRON | Cron expression to run backup | 0 0 12,0 * * ? |
If you want more information about the cron syntax used, please visit this website.
Docker-compose exemple:
---
version: '3.7'
services:
db:
image: mysql
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: rootp@ss0rd
MYSQL_DATABASE: myDatabase
MYSQL_USER: test_usr
MYSQL_PASSWORD: p@ssw0rd
backdata:
image: maximelaplanche/backdata
restart: always
environement:
DB_TYPE: mysql
DB_HOST: db
DB_PORT: 3306
DB_NAME: myDatabase
DB_USER: test_usr
DB_PASSWORD: p@ssw0rd
From a yaml file, you can configure BackData.
This file can be found here: /app/conf/backdata.yml
Look at this file for an example.
This file is loaded each time BackData is started.
Postgresql, SQLServer, etc..ssh, sftp, ftp, OneDrive, S3 service compatibleSee LICENSE here.
Project still in development.
Content type
Image
Digest
sha256:70c6ef162…
Size
78.8 MB
Last updated
almost 4 years ago
docker pull maximelaplanche/backdata