Skip to content

Commit 1086b75

Browse files
committed
chore(scripts): avoid different scripts doing the same thing
1 parent f854953 commit 1086b75

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN mkdir -p $WALE_ENVDIR \
1616
lzo \
1717
pv \
1818
util-linux \
19+
ca-certificates \
1920
python3=3.5.6-r0 \
2021
&& pip3 install --upgrade pip setuptools \
2122
&& pip install --disable-pip-version-check --no-cache-dir \

rootfs/bin/do_backup

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export BACKUPS_TO_RETAIN=${BACKUPS_TO_RETAIN:-5}
55
echo "Performing a base backup..."
66
if [[ -f "$PGDATA/recovery.conf" ]] ; then
77
echo "Database is currently recovering from a backup. Aborting"
8+
sleep 9
89
else
910
# perform a backup
1011
envdir "$WALE_ENVDIR" wal-e backup-push "$PGDATA"

rootfs/docker-entrypoint-initdb.d/003_restore_from_backup.sh

-12
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,8 @@ EOF
5353
su-exec postgres pg_ctl -D "$PGDATA" \
5454
-o "-c listen_addresses=''" \
5555
-w start
56-
57-
echo "Waiting for recovery completion..."
58-
while [ ! -f "$PGDATA/recovery.done" ]
59-
do
60-
sleep 2
61-
done
62-
su-exec postgres pg_ctl -D "$PGDATA" \
63-
-o "-c listen_addresses=''" \
64-
-w restart
6556
fi
6657

67-
echo "Performing an initial backup..."
68-
su-exec postgres envdir "$WALE_ENVDIR" wal-e backup-push "$PGDATA"
69-
7058
# ensure $PGDATA has the right permissions
7159
chown -R postgres:postgres "$PGDATA"
7260
chmod 0700 "$PGDATA"

0 commit comments

Comments
 (0)