This project leverages the innovative Bun runtime to provide a fast and efficient solution for backing up Postgres databases directly to Cloudflare's R2 storage, ensuring your data is securely stored and easily accessible.
- Bun runtime installed on your system
- Postgres server installed on your system
- Cloudflare account with R2 storage enabled
-
Clone this repository to your local machine using Bun:
bun clone https://github.com/meaple-com/postgres-r2-backup.git
-
Navigate to the project directory:
cd bun-postgres-r2-backup
-
Install dependencies:
bun install
- Rename the
.env.example
file to.env
and fill in your Postgres and Cloudflare R2 details.
Run the backup script with Bun:
```
# Production
bun run start
# Development
bun run dev
```