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

28 lines
797 B
Markdown

# 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
```