View gist:74986f14d2217c6e1363ca378e95ae99
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 | |
sql_dump() { | |
echo "Performing mysqldump on database $DBNAME @ $HOST" | |
MYSQL_PWD=$PASSWORD mysqldump -h $HOST -P 3306 -u root $DBNAME > $DBNAME.sql | |
} | |
restore() { | |
echo "Performing restore on database $DBNAME @ $HOST" | |
MYSQL_PWD=$PASSWORD mysql -h $HOST -P 3306 -u root $DBNAME < $DBNAME.sql |