Production-grade PostgreSQL backups from your terminal.
A Spring Shell CLI that runs pg_dump through a 5-step Spring Batch pipeline. Gzipped dumps, named connection profiles, JSON-structured logs, and a built-in job history — all in one binary.
$ db-backup-cli db-backup-cli> test-connection --profile prod ✓ connected to postgres://prod-db:5432 (PostgreSQL 16.2) db-backup-cli> backup --profile prod --output ./backups [1/5] validate-profile ok [2/5] check-pg-version ok [3/5] run-pg-dump 42.3 MB [4/5] gzip-compress 7.1 MB [5/5] persist-job-history ok ✓ backup complete → ./backups/prod-2026-05-11T1430.sql.gz
// features
Built like a service. Runs like a script.
Every backup goes through the same observable pipeline. No surprises, no ad-hoc shell wrappers.
Spring Batch pipeline
A deterministic 5-step flow: validate → version-check → dump → compress → persist. Restartable, observable, scriptable.
Gzip out of the box
Every dump is streamed through gzip so backups land 5–10× smaller without an extra command in your cron.
Named connection profiles
Define dev, staging, prod in application.yml. No flag soup at the prompt.
JSON structured logs
Ship straight to ELK, Datadog or Loki. Each step emits a structured record — easy to alert on, easy to grep.
Embedded job history
An embedded H2 store records every run with status, duration, size, and exit code. Query past jobs from the shell.
PostgreSQL 13+
Built on pg_dump 17+. MySQL / MariaDB land in a future phase — open an issue with your use case.
// install
Pick your install path.
Four ways to get DB Backup CLI running. The native binary is fastest to start; the .jar is the smallest universal option.
Pre-built native binary via GraalVM. Pick your OS:
curl -LO https://github.com/jircik/DB-Backup-CLI/releases/download/v0.1.1/db-backup-cli chmod +x db-backup-cli ./db-backup-cli
Invoke-WebRequest ` -Uri https://github.com/jircik/DB-Backup-CLI/releases/download/v0.1.1/db-backup-cli.exe ` -OutFile db-backup-cli.exe .\db-backup-cli.exe
No JVM required. Cold-start under ~50 ms thanks to GraalVM native-image. On macOS? — a native macOS binary isn't published yet. All v0.1.1 assets ↗
Universal fat-jar. Runs on any platform with Java 21+ — including macOS.
curl -LO https://github.com/jircik/DB-Backup-CLI/releases/download/v0.1.1/db-backup-cli-0.1.0-SNAPSHOT.jar java -jar db-backup-cli-0.1.0-SNAPSHOT.jar
Same feature set as the native binary, but starts in ~1–2 s (JVM warmup). Release notes ↗
Grab a bleeding-edge build straight off main — no release required.
- 1 Open the Actions tab on GitHub.
- 2 Pick the latest green CI / build run on main.
- 3 Scroll to Artifacts and download db-backup-cli-jar.
- 4 Unzip and run java -jar db-backup-cli-*.jar.
Artifacts expire after 90 days. You'll need a GitHub account to download them.
Compile locally. Useful for contributing or pinning to a commit.
git clone https://github.com/jircik/DB-Backup-CLI.git cd DB-Backup-CLI ./mvnw package -DskipTests java -jar target/db-backup-cli-0.1.0-SNAPSHOT.jar
// quickstart
Your first backup in 60 seconds.
Once installed, define a profile and run two commands.
db-backup: profiles: dev: host: localhost port: 5432 database: app user: postgres password: ${PG_PASS}
db-backup-cli> test-connection \ --profile dev ✓ connected to postgres://localhost:5432 (PostgreSQL 16.2)
db-backup-cli> backup \ --profile dev \ --output ./backups ✓ → ./backups/ dev-2026-05-11T1430.sql.gz
Ready to ditch the cron-and-shell-script combo?
DB Backup CLI is open-source, MIT-licensed, and v0.1.1 is out today.