Created
November 20, 2017 20:03
-
-
Save daryllxd/854679f2e0fc860368cf65247d57054f to your computer and use it in GitHub Desktop.
staging_dump.sh
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 | |
set -x | |
DATABASE_DUMP_FILE=wew.sql | |
rm $DATABASE_DUMP_FILE | |
pgrep ruby > /dev/null | |
if [ $? -eq 0 ]; then | |
killall -9 ruby | |
fi | |
ssh golfcrow-staging "pg_dump -a -U sp_west1a -d golfcrow_staging -h HOST_NAME -C --column-inserts" \ >> $DATABASE_DUMP_FILE | |
bundle exec rake db:reset | |
psql golfcrow_development < $DATABASE_DUMP_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment