GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - code-lts/sql-backup: Backup your MySQL/MariaDB server ( structure, data, users, grants, views, triggers, routines, events )

BranchesTags
Open more actions menu

Latest commit

 

History

67 Commits
67 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
samples
samples
 
 
.env.dist
.env.dist
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
LICENSE.sig
LICENSE.sig
 
 
README.md
README.md
 
 
backup.sh
backup.sh
 
 
postTest.sh
postTest.sh
 
 
run-tests.sh
run-tests.sh
 
 
tests.sh
tests.sh
 
 

Repository files navigation

sql-backup - Backup your MySQL / MariaDB server !

Codacy Badge Actions Status codecov License: Unlicense FOSSA Status CII Best Practices

Backup your MySQL / MariaDB server ( structure, data, users, grants, views, triggers, routines, events )

Install

Clone the repository

curl -L -# -o sql-backup.zip https://github.com/code-lts/sql-backup/archive/refs/tags/v1.2.0.zip

Unzip file

unzip sql-backup.zip

Move into the directory

cd sql-backup-1.2.0/

Copy the configuration example

cp .env.dist .env

Edit your configuration file

Nano

nano .env

Vi

vi .env

Start backup

Execute this command to start the backup !

./backup.sh

Extras

To use an external env file in a custom location, example :

export BACKUP_CONFIG_ENVFILE="/home/myuser/secretbackupconfig.env.txt"

./backup.sh

unset BACKUP_CONFIG_ENVFILE

You can use the variables of the env file in the ON_SUCCESS variable, example :

ON_SUCCESS="${BACKUP_DIR}/onsuccessscript.sh"

Options

NAME DEFAULT VALUE OPTIONAL
BACKUP_DIR NO
MYSQL_HOST NO
MYSQL_USER NO
MYSQL_PASS YES
MYSQL_PORT 3306 YES
SKIP_DATABASES YES
EXPERT_ARGS --default-character-set=utf8 --extended-insert=FALSE --single-transaction --skip-comments --skip-dump-date --hex-blob --tz-utc YES
ON_SUCCESS YES
SKIP_OP YES

ON_SUCCESS is called on script success

Example .env

BACKUP_DIR=/sql_backup
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASS=root
MYSQL_PORT=3306
SKIP_DATABASES=mysql,sys,information_schema,performance_schema,phpmyadmin
SKIP_OP=users,grants

Files

NAME DESCRIPTION
database.sql All the data
structure.sql The structure of the databases and tables
grants.sql The grants for all users except root
events.sql The scheduled events
views.sql The views
triggers.sql The triggers
routines.sql All the procedures & functions
users.sql All MySQL users

License

FOSSA Status

About

Backup your MySQL/MariaDB server ( structure, data, users, grants, views, triggers, routines, events )

Topics

mariadb-backupmysql-backupmysqldumpmysqldump-backupsql-backup

Resources

Readme
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.