Created
October 1, 2017 16:37
-
-
Save ashokarun/7a5f697d3f71f243372b6526fccc810a to your computer and use it in GitHub Desktop.
To backup all the databases in the server as separate individual sql files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Author : Arunlal A | |
#Website: https://www.crybit.com | |
echo "Staring database backup process..." | |
for db in `echo 'show databases;' |mysql |grep -Ev "Database|information_schema|performance_schema"`; do mysqldump $db | gzip > /backup/$db.sql.gz ;done | |
echo "Done! Check /backup/ directory for your SQL files." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer : https://www.crybit.com/managing-mysql-databases/