GithubHelp home page GithubHelp logo

mydbdumper's Introduction

MyDBDumper

This is a script to dump MySQL or MariaDB databases and mail it to a given address. A configurable number of backups is kept locally. It uses mysqldump for dumping and gzip for compressing so both are required as well as access to the proc_open PHP function. It uses PHPMailer for email sending and Process for executing command line programs.

Requirements

  • PHP > 7.2.5
  • a MySQL or MariaDB database
  • enabled proc_open function
  • mysqldump executable
  • gzip executable

Installation

From Git

  • Clone this repo git clone https://github.com/e-dschungel/mydbdumper
  • Install dependencies using composer composer install --no-dev
  • Rename config/config.dist.php to config/config.conf.php and edit it according to your needs
  • Create DBNAME.conf.php, see Configuration

From ZIP file

  • Download myDBDumper.zip (NOT Source Code (zip) or Source Code (tar.gz)) from https://github.com/e-dschungel/mydbdumper/releases/latest
  • Extract and upload it to your webserver
  • Rename config/config.dist.php to config/config.conf.php and edit it according to your needs, see below
  • Create DBNAME.conf.php, see Configuration

Configuration

The configuration is loaded from (at least) two files: the general file config.conf.php and a specific file DBNAME.conf.php for a database with the name DBNAME. The specific file DBNAME.conf.php will be loaded after config.conf.php and will overwrite settings given in config.conf.php.

variable description
$config['backupDir'] Directory to which to backups are stored
$config['emailTo'] email adress of the recipient, multiple recipients can be given separated by comma, e.g. $config['emailTo'] = "[email protected], [email protected]";
$config['emailFrom'] email adress shown as sender of the dump
$config['maxNrBackups'] Number of backups to keep locally, if more backups exist, they are deleted
$config['SMTPHost'] SMTP hostname
$config['SMTPAuth'] use SMTP authentication? true or false
$config['SMTPUsername'] SMTP username
$config['SMTPPassword'] SMTP password
$config['SMTPSecurity'] type of SMTP security setting, can be "starttls" or "smtps"
$config['SMTPPort'] SMTP port
$config['username'] MySQL/MariaDB username
$config['password']

Changelog

Version 0.1

  • first public release

Version 0.1.1

  • update PHPMailer to 6.6.5
  • update Process to 5.4.11

Version 0.1.2

  • improved handling if backup dir does not exist
  • update dev dependencies

Version 0.1.3

  • update PHPMailer to 6.7.1
  • update Process to 5.4.19
  • update dev dependencies
  • correctly document minimal PHP version (due to process dependency)

Version 0.1.4

  • update PHPMailer to 6.8.0
  • update Process to 5.4.21
  • update dev dependencies

Version 0.1.5

  • update PHPMailer to 6.8.1
  • update Process to 5.4.28
  • update dev dependencies

Version 0.1.6

  • update PHPMailer to 6.9.1
  • update dev dependencies

mydbdumper's People

Contributors

e-dschungel avatar

Watchers

 avatar

Forkers

gtbu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.