14 lines
271 B
Bash
Executable File
14 lines
271 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -exu
|
|
|
|
SERVER=root@185.103.252.32
|
|
PSQL="sudo -u postgres psql"
|
|
DB=db2026
|
|
|
|
scp schema.sql data.sql "$SERVER:/tmp/$DB/"
|
|
ssh $SERVER \
|
|
"chmod -R 777 /tmp/$DB;" \
|
|
"$PSQL -d $DB -e -q -f /tmp/$DB/schema.sql;" \
|
|
"$PSQL -d $DB -e -q -f /tmp/$DB/data.sql;"
|