Skip to content

Commit 7421eaa

Browse files
author
Alexander Bondarev
committed
Add support for restore_target which may be used to expose backup from container
1 parent f54136b commit 7421eaa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

9.6/docker-entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ else
4343
echo "Get the latest available basebackup ..."
4444
gosu postgres pghoard_restore get-basebackup --config pghoard_restore.json --site $PGHOARD_RESTORE_SITE --target-dir restore --restore-to-master --recovery-target-action promote --recovery-end-command "pkill pghoard" --overwrite "$@"
4545

46-
# remove custom server configuration (espacially the hot standby parameter)
46+
# remove custom server configuration (especially the hot standby parameter)
4747
gosu postgres mv restore/postgresql.auto.conf restore/postgresql.auto.conf.backup
4848

49-
echo "Start the pghoard daemon ..."
50-
gosu postgres pghoard --short-log --config /home/postgres/pghoard_restore.json &
51-
52-
if [ -z "$RESTORE_CHECK_COMMAND" ]; then
49+
# If you want to get DB files outside of Docker container you can use mount to /home/postgres/restore_target
50+
if [ -d "restore_target" ]; then
51+
mv restore/* restore_target/
52+
elif [ -z "$RESTORE_CHECK_COMMAND" ]; then
5353
# Manual mode
5454
# Just start PostgreSQL
5555
echo "Start PostgresSQL ..."

0 commit comments

Comments
 (0)