An open API service indexing awesome lists of open source software.

https://github.com/alfiosalanitri/backup-mysql

Export all mysql databases in singular database_name.sql.gz file and archive all dumps in a tar.xz archive file.
https://github.com/alfiosalanitri/backup-mysql

backup bash mysql

Last synced: about 1 year ago
JSON representation

Export all mysql databases in singular database_name.sql.gz file and archive all dumps in a tar.xz archive file.

Awesome Lists containing this project

README

          

# NAME
backup-mysql - create a tar archive with databases stored in .sql.gz separated file.

# DESCRIPTION
this script dump all databases into singular database.sql.gz file and create an archive .tar.xz into current script directory.

# INSTALLATION
- rename .config.example to .config
- edit .config file with your data
- `sudo chown root:root /path/to/backup-mysql`
- `sudo chown root:root /path/to/.config`
- `sudo chmod 600 /path/to/.config`
- `sudo chmod +x /path/to/backup-mysql`

# USAGE
`./backup-mysql /path/to/.config /path/to/backup/destination`

# HOW TO restore a singular database?
`zcat database.sql.gz | mysql -u username -p database_name`

# AUTHOR:
backup-mysql is written by Alfio Salanitri www.alfiosalanitri.it and are licensed under the MIT License.