Skip to content

cakebake/EightDump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

EightDump

Scheduled MySQL dump & check.

Features

  • Creates GZip MySQL backups
  • Optimizes/Repairs MySQL database
  • Deletes old backups after a specified time
  • Usable with cron, but also manually
  • Environment file support
  • Global environment variables support
  • Supports MariaDb
  • Logging

Installation

mkdir -p ~/bin && \
wget https://raw.githubusercontent.com/cakebake/EightDump/main/eightdump.sh -O ~/bin/eightdump && \
chmod +x ~/bin/eightdump

Check if ~/bin is in the global $PATH or add it. Example: echo "export PATH=$PATH:$HOME/bin" >> ~/.bashrc

Configuration

Create or edit a configuration file with following variables.

BACKUP_USER=user
BACKUP_PASSWORD=password
BACKUP_HOST=localhost
BACKUP_PORT=3306
BACKUP_DATABASE=name
BACKUP_DESTINATION_DIR=/var/www/html/project/backup
BACKUP_KEEP_MINUTES=10080

Usage

CLI

eightdump /path/to/.env

Cron

# every day 04h00
0 4 * * * /home/name/bin/eightdump /path/to/.env >/dev/null 2>&1
# every 6h
0 */6 * * * /home/name/bin/eightdump /path/to/.env >/dev/null 2>&1