Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
To backup all the databases in the server as separate individual sql files
#!/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."
@ashokarun

This comment has been minimized.

Copy link
Owner Author

@ashokarun ashokarun commented Oct 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment