797 B
797 B
sanity
Sanity runs scheduled compressed database backups and sends Discord notifications for every run.
How it works:
- Every
backup.interval, Sanity readsbackup.source_file. - It writes a gzip artifact in
backup.output_dirnamedfile_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_idwhen configured.
Config
Copy config.example.yaml to config.yaml and set:
server_namediscord_webhook_urlnotify_role_id(optional)backup.interval(for example24h)backup.source_filebackup.output_dirbackup.file_prefix
Run
go build -o sanity ./cmd/sanity
./sanity --config ./config.yaml