Skip to content

Instantly share code, notes, and snippets.

@daryllxd
Created November 20, 2017 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daryllxd/854679f2e0fc860368cf65247d57054f to your computer and use it in GitHub Desktop.
Save daryllxd/854679f2e0fc860368cf65247d57054f to your computer and use it in GitHub Desktop.
staging_dump.sh
#!/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