Created
January 21, 2020 23:50
-
-
Save treyhuffine/17760f99b025fec29bf9f1d86aa656d4 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
#!/usr/bin/env bash | |
echo "Restoring database" | |
psql -U postgres -c "CREATE DATABASE ${DBNAME}" | |
pg_restore -v -d ${DBNAME} /tmp/${FILE} > /tmp/log | |
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE ${DBNAME} TO postgres" | |
echo "Database restored successfully" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment