Skip to content

Commit 48ce48a

Browse files
committed
Use curl to download backup
1 parent c982b73 commit 48ce48a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

backup.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ case "${PG_BACKUP_ACTION:-dump}" in
4747
fi
4848
;;
4949
restore)
50-
echo "Downloading latest snapshot from $S3_BUCKET/$S3_PATH/$S3_FILENAME"
51-
aws $AWS_ARGS s3 cp s3://$S3_BUCKET/$S3_PATH/$S3_FILENAME.backup dump.backup --acl public-read || exit 2
50+
if [ -z "${PG_BACKUP_FILE}" ]; then
51+
echo "Please set PG_BACKUP_FILE variable"
52+
exit 1
53+
fi
54+
55+
echo "Downloading latest snapshot from $PG_BACKUP_FILE"
56+
curl -o dump.backup $PG_BACKUP_FILE
5257

5358
echo "Restoring $POSTGRES_DB database"
5459
pg_restore -C -d $POSTGRES_DB $POSTGRES_HOST_OPTS dump.backup

0 commit comments

Comments
 (0)