Sign inSign up

maximelaplanche/backdata

By maximelaplanche

•Updated almost 4 years ago

Image
0

199

maximelaplanche/backdata repository overview

⁠BackData

GitLab Activity GitLab license Gitlab build Docker pulls Docker size Docker version GitLab release

Docker container to Backup your Mysql & Postgres databases.

⁠About

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.

⁠Maintainer

⁠Prerequisites and Assumptions

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.

⁠Usages

⁠Persitent storage

The following directories are used for the configuration and data of the container, they must be persistent.

DirectoryDescription
/app/backupBackups
/app/confConfiguration files
⁠Environment Variables

Warning: If you use environment variables, the functionality is limited. Go to the file-based configuration section for advanced features.

⁠Backup options
Env. varDescriptionDefault
DB_TYPEDb server type to backup : mysqlmysql
DB_HOSTName of db server to backup
DB_PORTPort of db server to backup3306
DB_NAMEName of db to backup
DB_USERUser of db to backup
DB_PASSWORDPassword of db to backup
DB_BACKUP_CRONCron expression to run backup0 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

⁠Manual configuration

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.

⁠Roadmap

  • Support for other database servers: Postgresql, SQLServer, etc..
  • Send backups securely to third-party services: ssh, sftp, ftp, OneDrive, S3 service compatible

⁠License

See LICENSE here⁠.

⁠Project status

Project still in development.

Tag summary

Content type

Image

Digest

sha256:70c6ef162…

Size

78.8 MB

Last updated

almost 4 years ago

docker pull maximelaplanche/backdata