Skip to content

Instantly share code, notes, and snippets.

@jackreichert
Last active October 8, 2016 01:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackreichert/a4768549cedbe9479a6f to your computer and use it in GitHub Desktop.
Save jackreichert/a4768549cedbe9479a6f to your computer and use it in GitHub Desktop.
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."
if [ -e /vagrant/backup/db.sql ]
then
sudo mysql -p'root' play < /vagrant/backup/db.sql
echo "imported db..."
fi
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