Last active
October 8, 2016 01:54
-
-
Save jackreichert/a4768549cedbe9479a6f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sudo mkdir -p /vagrant/backup | |
echo "Backing up db..." | |
sudo mysqldump --add-drop-database -u root -p'root' play > /vagrant/backup/db.sql | |
echo "DB backup done." |
This file contains hidden or 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
if [ -e /vagrant/backup/db.sql ] | |
then | |
sudo mysql -p'root' play < /vagrant/backup/db.sql | |
echo "imported db..." | |
fi |
This file contains hidden or 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
config.trigger.before :halt do | |
info "Dumping the database before shutting down..." | |
run_remote "bash /vagrant/assets/exportdb.sh" | |
run_remote "bash /vagrant/assets/gz-wpcontent.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment