explaingit

brayzonn/vps-pg-backup

Analysis updated 2026-05-18

0GoAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

An automated tool that backs up a PostgreSQL database nightly to cloud storage and alerts you if a backup ever fails.

Mindmap

mindmap
  root((VPS PG Backup))
    What it does
      Backs up PostgreSQL nightly
      Uploads to cloud storage
      Rotates old backups
    Tech stack
      Go
      PostgreSQL
      AWS CLI
      Docker
    Use cases
      Scheduled backups
      Failure alerts
      Backup restore drills
    Audience
      DevOps engineers
      Self hosters
      Sysadmins

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automatically back up a PostgreSQL database every night to S3-compatible cloud storage.

USE CASE 2

Keep daily, weekly, and monthly backup tiers with automatic cleanup of old files.

USE CASE 3

Get alerted immediately if a scheduled backup fails or silently stops running.

USE CASE 4

Restore a database backup and verify it works using a throwaway test container.

What is it built with?

GoPostgreSQLAWS CLIDocker

How does it compare?

brayzonn/vps-pg-backupaasheeshlikepanner/vasealexzielenski/controller-runtime
Stars00
LanguageGoGoGo
Last pushed2022-04-20
MaintenanceDormant
Setup difficultymoderatemoderatehard
Complexity3/54/54/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires Go to build, an S3-compatible bucket, and a cron job on a VPS.

In plain English

This project is a tool that automatically backs up a PostgreSQL database every night and keeps those backups safe in the cloud. It runs on a schedule, dumps the database, compresses the file, and uploads it to a cloud storage service that works like Amazon S3, such as Cloudflare R2 or Backblaze B2. It then organizes older backups into daily, weekly, and monthly folders, deleting ones that are past their expiration window so storage does not grow forever. The retention setup follows a common backup pattern: daily backups are kept for two weeks, weekly backups made every Sunday are kept for about two months, and monthly backups made on the first of the month are kept for roughly six months. All of these time windows can be adjusted through settings. A key part of the tool is that it watches itself for failures in two separate ways. First, if something goes wrong during the backup process itself, such as the upload failing or the dump coming out empty, it sends a failure alert to a notification service, which can then forward that alert to Discord, Slack, or similar tools. Second, it also pings an outside monitoring service called healthchecks.io every time a backup succeeds. If that outside service does not hear from the backup tool within about a day, it raises its own alarm, which catches problems the first alert system might miss, like the whole server being down or the scheduled job never running at all. The tool is written in Go and compiles into a single standalone program, so it can be copied onto a server and run without installing extra software. All of its settings, including database details, cloud storage credentials, and alert webhook addresses, are provided through environment variables rather than being written into the code. The README also explains how to restore a backup using the AWS command line tool and how to test that a backup actually works by restoring it into a temporary, throwaway database container.

Copy-paste prompts

Prompt 1
Help me set up the environment variables needed to run this PostgreSQL backup tool.
Prompt 2
Explain how the daily, weekly, and monthly retention tiers work in this backup system.
Prompt 3
Show me how to configure healthchecks.io monitoring for this backup tool.
Prompt 4
Help me restore a backup from Cloudflare R2 using the AWS CLI as described in this README.

Frequently asked questions

What is vps-pg-backup?

An automated tool that backs up a PostgreSQL database nightly to cloud storage and alerts you if a backup ever fails.

What language is vps-pg-backup written in?

Mainly Go. The stack also includes Go, PostgreSQL, AWS CLI.

How hard is vps-pg-backup to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is vps-pg-backup for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.