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.
- Host: GitHub
- URL: https://github.com/alfiosalanitri/backup-mysql
- Owner: alfiosalanitri
- License: mit
- Created: 2021-09-30T15:39:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-12T15:08:04.000Z (over 3 years ago)
- Last Synced: 2025-05-07T06:46:24.378Z (about 1 year ago)
- Topics: backup, bash, mysql
- Language: Shell
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.