Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions content/docs/manage/backups-aws-s3-backup-part-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ jobs:

- name: Run pg_dump
run: |
$POSTGRES/pg_dump ${{ env.DATABASE_URL }} | gzip > "${{ env.GZIP_NAME }}"
set -o pipefail
: "${DATABASE_URL:?DATABASE_URL secret is not set}"
"${POSTGRES}/pg_dump" "$DATABASE_URL" | gzip > "$GZIP_NAME"

- name: Empty bucket of old files
run: |
Expand Down Expand Up @@ -255,9 +257,13 @@ This step runs `pg_dump` and saves the output in the Action's virtual memory usi
```yml
- name: Run pg_dump
run: |
$POSTGRES/$pg_dump ${{ env.DATABASE_URL }} | gzip > "${{ env.GZIP_NAME }}"
set -o pipefail
: "${DATABASE_URL:?DATABASE_URL secret is not set}"
"${POSTGRES}/pg_dump" "$DATABASE_URL" | gzip > "$GZIP_NAME"
```

Enabling `pipefail` ensures the workflow fails when `pg_dump` fails instead of reporting success because `gzip` completed.

## Empty bucket of old files

This optional step automatically removes `.gz` files older than the retention period specified by the `RETENTION` variable. It checks the `FOLDER_NAME` directory and deletes outdated backups to save storage space.
Expand Down