Skip to content

Commit

Permalink
move -j and -c/-C flags to postgres extra opts
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed Mar 19, 2022
1 parent 74db798 commit f61c4ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ backuper:
- POSTGRES_DB=${POSTGRES_DB:-dipdup}
- POSTGRES_HOST=${POSTGRES_HOST:-db}
- POSTGRES_EXTRA_OPTS=${POSTGRES_EXTRA_OPTS}
- PG_BACKUP_ACTION=${PG_BACKUP_ACTION:-dump} # or restore
- PG_BACKUP_FILE=${PG_BACKUP_FILE} # for restore
- HEARTBEAT_URI=${HEARTBEAT_URI}
- SCHEDULE=${SCHEDULE}
```
Expand Down
6 changes: 1 addition & 5 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,10 @@ case "${PG_BACKUP_ACTION:-dump}" in
exit 1
fi

if [ -z "${PG_RESTORE_JOBS}" ]; then
PG_RESTORE_JOBS=1
fi

echo "Downloading latest snapshot from $PG_BACKUP_FILE"
curl -o dump.backup $PG_BACKUP_FILE

echo "Restoring $POSTGRES_DB database"
pg_restore -v -c -C -d $POSTGRES_DB $POSTGRES_HOST_OPTS -j $PG_RESTORE_JOBS dump.backup
pg_restore -v -d $POSTGRES_DB $POSTGRES_HOST_OPTS dump.backup
;;
esac

0 comments on commit f61c4ca

Please sign in to comment.