Created
August 14, 2014 00:21
-
-
Save tsohr/cbe3765df9d4ded46b68 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
| #!/bin/bash | |
| if [ -z "$1" ]; then | |
| echo "$0: need an input set file"; | |
| exit 1; | |
| fi | |
| if [ ! -f "$1" ]; then | |
| echo "$0: file not found '$1'"; | |
| exit 1; | |
| fi | |
| systemctl stop postgresql.service | |
| rm -rf /srv/pgsql/data/ | |
| su -c "initdb /srv/pgsql/data" postgres | |
| systemctl start postgresql.service | |
| cat "$1" | gunzip | su -c "psql --echo-hidden" postgres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment