Skip to content

A simple Bun app to automatically backup PostgreSQL databases to an S3 bucket

Notifications You must be signed in to change notification settings

logic-pad/postgres-s3-backups

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgres S3 backups

A simple Bun application to backup your PostgreSQL database to S3 via a cron.

Deploy on Railway

Configuration

  • AWS_ACCESS_KEY_ID - AWS access key ID.

  • AWS_SECRET_ACCESS_KEY - AWS secret access key, sometimes also called an application key.

  • AWS_S3_BUCKET - The name of the bucket that the access key ID and secret access key are authorized to access.

  • AWS_S3_REGION - The name of the region your bucket is located in, set to auto if unknown.

  • BACKUP_DATABASE_URL - The connection string of the database to backup.

  • AWS_S3_ENDPOINT - The S3 custom endpoint you want to use. Applicable for 3-rd party S3 services such as Cloudflare R2 or Backblaze R2.

  • BACKUP_FILE_PREFIX - Add a prefix to the file name.

  • BUCKET_SUBFOLDER - Define a subfolder to place the backup files in.

  • BACKUP_OPTIONS - Add any valid pg_dump option, supported pg_dump options can be found here. Example: --exclude-table=pattern

  • BACKUP_RETENTION_DAYS - Number of days to retain backups in S3. Backups older than this value will be deleted automatically.

  • PG_VERSION - Specify a custom PostgreSQL version to override the default version set in the Dockerfile.

About

A simple Bun app to automatically backup PostgreSQL databases to an S3 bucket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 91.1%
  • Dockerfile 8.9%