todor ac836d0b67
All checks were successful
Build sanity / build (push) Successful in 11s
init
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00
2026-05-31 18:00:20 +02:00

sanity

Sanity runs scheduled compressed database backups and sends Discord notifications for every run.

How it works:

  • Every backup.interval, Sanity reads backup.source_file.
  • It writes a gzip artifact in backup.output_dir named file_prefix-YYYYMMDD-HHMMSS.gz.
  • On success, it sends a green Discord embed with artifact path, size, and duration.
  • On failure, it sends a red Discord embed with the error reason and pings notify_role_id when configured.

Config

Copy config.example.yaml to config.yaml and set:

  • server_name
  • discord_webhook_url
  • notify_role_id (optional)
  • backup.interval (for example 24h)
  • backup.source_file
  • backup.output_dir
  • backup.file_prefix

Run

go build -o sanity ./cmd/sanity
./sanity --config ./config.yaml
Description
Database backup tool
Readme 35 KiB
Languages
Go 100%