You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ben@debian:postgres-backup-container$ docker run -v /backup:/pg_backup babvin/postgres-back-up
Creating dump: backupOn2019-08-26-18-22.dump
pg_dumpall: could not connect to database "template1": could not translate host name "localhost:5432" to address: Name does not resolve Back up not created, check db connection settings
ben@debian:postgres-backup-container$
ben@debian:postgres-backup-container$ docker run -v /backup:/pg_backup babvin/postgres-back-up
Creating dump: backupOn2019-08-26-18-22.dump
pg_dumpall: could not connect to database "template1": could not translate host name "localhost:5432" to address: Name does not resolve Back up not created, check db connection settings
ben@debian:postgres-backup-container$
ben@debian:postgres-backup-container$ cat dumpDatabase.sh
DUMP_FILE_NAME="backupOn
date +%Y-%m-%d-%H-%M
.dump"echo "Creating dump: $DUMP_FILE_NAME"
cd pg_backup
PGPASSWORD=password pg_dumpall -U postgres > $DUMP_FILE_NAME
if [ $? -ne 0 ]; then
rm $DUMP_FILE_NAME
echo "Back up not created, check db connection settings"
exit 1
fi
echo 'Successfully Backed Up'
exit 0
ben@debian:postgres-backup-container$
ben@debian:postgres-backup-container$ cat Dockerfile
FROM alpine:3.6
ENV PGHOST='localhost:5432'
#ENV PGHOST='192.168.99.101'
ENV POSTGRES_PORT=5432
ENV PGDATABASE='postgres'
ENV PGUSER='postgres@postgres'
ENV PGPASSWORD='password'
RUN apk update
RUN apk add postgresql
COPY dumpDatabase.sh .
ENTRYPOINT [ "/bin/sh" ]
CMD [ "./dumpDatabase.sh" ]
ben@debian:postgres-backup-container$
The text was updated successfully, but these errors were encountered: