Skip to content

Commit

Permalink
backup all dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
barankaynak committed Sep 29, 2020
1 parent 08a7050 commit 52999fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ echo "Creating dump of ${POSTGRES_DATABASE} database from ${POSTGRES_HOST}..."
SRC_FILE=dump.sql.gz
DEST_FILE=${POSTGRES_DATABASE}_$(date +"%Y-%m-%dT%H:%M:%SZ").sql.gz

pg_dump $POSTGRES_HOST_OPTS $POSTGRES_DATABASE | gzip > $SRC_FILE
if [ "${POSTGRES_DATABASE}" == "all" ]; then
pg_dumpall $POSTGRES_HOST_OPTS | gzip > $SRC_FILE
else
pg_dump $POSTGRES_HOST_OPTS $POSTGRES_DATABASE | gzip > $SRC_FILE
fi


if [ "${ENCRYPTION_PASSWORD}" != "**None**" ]; then
>&2 echo "Encrypting ${SRC_FILE}"
Expand Down

0 comments on commit 52999fd

Please sign in to comment.