Skip to content

Commit 4436bc5

Browse files
added password env
1 parent c93188d commit 4436bc5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

postgres/scripts/v1_to_v2/copy_to_csv.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
USER=mapswipe-workers
55
NAME=mapswipe
66
7+
PGPASSWORD=yourpass
78

89
# Create a ssh tunnel in the background and save PID
910
ssh -Cfo ExitOnForwardFailure=yes -NL 1111:localhost:5432 ${SSH_REMOTE_HOST}
1011
PID=$(pgrep -f 'NL 1111:')
1112

12-
psql -p 1111 -h localhost -U ${USER} -d ${NAME} -a -f copy_to_csv.sql
13-
psql -p 1111 -h localhost -U ${USER} -d ${NAME} -a -f copy_results_to_csv.sql
13+
PGPASSWORD=$PGPASSWORD psql -p 1111 -h localhost -U ${USER} -d ${NAME} -a -f copy_to_csv.sql
14+
PGPASSWORD=$PGPASSWORD psql -p 1111 -h localhost -U ${USER} -d ${NAME} -a -f copy_results_to_csv.sql
1415

1516
kill ${PID}

0 commit comments

Comments
 (0)