init
All checks were successful
Build sanity / build (push) Successful in 11s

This commit is contained in:
2026-05-31 18:00:20 +02:00
commit ac836d0b67
11 changed files with 638 additions and 0 deletions

27
README.md Normal file
View File

@@ -0,0 +1,27 @@
# 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
```bash
go build -o sanity ./cmd/sanity
./sanity --config ./config.yaml
```