Skip to content

Commit bd160b7

Browse files
authored
Merge branch 'eeshugerman:master' into master
2 parents 092c0df + ecb08ff commit bd160b7

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

.github/workflows/build-and-push-images.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
strategy:
1111
matrix:
1212
include:
13-
- { postgres: 11, alpine: '3.10' }
1413
- { postgres: 12, alpine: '3.12' }
1514
- { postgres: 13, alpine: '3.14' }
1615
- { postgres: 14, alpine: '3.16' }
1716
- { postgres: 15, alpine: '3.17' }
17+
- { postgres: 16, alpine: '3.19' }
1818

1919
steps:
2020
- name: Checkout repository

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This project provides Docker images to periodically back up a PostgreSQL databas
66
```yaml
77
services:
88
postgres:
9-
image: postgres:13
9+
image: postgres:16
1010
environment:
1111
POSTGRES_USER: user
1212
POSTGRES_PASSWORD: password
1313

1414
backup:
15-
image: eeshugerman/postgres-backup-s3:15
15+
image: eeshugerman/postgres-backup-s3:16
1616
environment:
1717
SCHEDULE: '@weekly' # optional
1818
BACKUP_KEEP_DAYS: 7 # optional
@@ -28,20 +28,25 @@ services:
2828
POSTGRES_PASSWORD: password
2929
```
3030
31-
- Images are tagged by the major PostgreSQL version supported: `11`, `12`, `13`, `14`, or `15`.
31+
- Images are tagged by the major PostgreSQL version supported: `12`, `13`, `14`, `15` or `16`.
3232
- The `SCHEDULE` variable determines backup frequency. See go-cron schedules documentation [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules). Omit to run the backup immediately and then exit.
3333
- If `PASSPHRASE` is provided, the backup will be encrypted using GPG.
3434
- Run `docker exec <container name> sh backup.sh` to trigger a backup ad-hoc.
3535
- If `BACKUP_KEEP_DAYS` is set, backups older than this many days will be deleted from S3.
3636
- Set `S3_ENDPOINT` if you're using a non-AWS S3-compatible storage provider.
3737

3838
## Restore
39-
> **WARNING:** DATA LOSS! All database objects will be dropped and re-created.
39+
> [!CAUTION]
40+
> DATA LOSS! All database objects will be dropped and re-created.
41+
4042
### ... from latest backup
4143
```sh
4244
docker exec <container name> sh restore.sh
4345
```
44-
> **NOTE:** If your bucket has more than a 1000 files, the latest may not be restored -- only one S3 `ls` command is used
46+
47+
> [!NOTE]
48+
> If your bucket has more than a 1000 files, the latest may not be restored -- only one S3 `ls` command is used
49+
4550
### ... from specific backup
4651
```sh
4752
docker exec <container name> sh restore.sh <timestamp>

src/backup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ s3_uri_base="s3://${S3_BUCKET}/${S3_PREFIX}/${POSTGRES_DATABASE}_${timestamp}.du
1919

2020
if [ -n "$PASSPHRASE" ]; then
2121
echo "Encrypting backup..."
22+
rm -f db.dump.gpg
2223
gpg --symmetric --batch --passphrase "$PASSPHRASE" db.dump
2324
rm db.dump
2425
local_file="db.dump.gpg"

src/install.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ apk add postgresql-client
1111
# install gpg
1212
apk add gnupg
1313

14-
apk add python3
15-
apk add py3-pip # separate package on edge only
16-
pip3 install awscli
14+
apk add aws-cli
1715

1816
# install go-cron
1917
apk add curl

0 commit comments

Comments
 (0)