Backups watch: For developers
How Backups watch is built, for anyone who wants to change it or make one like it. It is MIT, by TheMightyTRexUK, and works with plug-in API >=1.17 <2.0.
Its files
starboard-plugin.jsonapp.pysbplugin.pyDockerfileinstall.pylogo.svgCHANGELOG.mdtests/test_backups_watch.py
Containers
| Container | Network | Folders | Runs as | Starts | Limits |
|---|---|---|---|---|---|
main |
lan |
data |
10001:10001 |
when_needed |
48 MB, 0.1 core |
The image is the shared examples image. Until it is built and pinned by digest, the manifest names its next tag.
What Starboard calls
| Path | What it is |
|---|---|
GET /health |
Health: 200 while it can work |
GET /card |
The Backups card (status) |
GET /runs |
The Backup runs card (list) |
GET /sizes |
The Backup sizes card (sparkline) |
POST /check |
The Check now button |
POST /jobs/check |
The job Check the backups, every hour, 2 minutes at most |
POST /update/before |
The update's before step, 60 seconds at most |
POST /update/after |
The update's after step, 10 seconds at most |
How it works
- The job asks the tool once and keeps the answer in
/data/state.json. The three cards read only that file, so a card never wakes the backup tool. - Backrest:
POST <address>/v1.Backrest/GetSummaryDashboardwith a JSON body of{}and the headerConnect-Protocol-Version: 1. Each entry ofplanSummariesis one backup:recentBackups(times, statuses and bytes added in step),backupsFailed30days,protectedBytes. 64 bit numbers may arrive as text. - Kopia:
GET <address>/api/v1/control/sourceswith HTTP Basic sign-in. Each entry ofsourcesis one backup:lastSnapshotwithendTime,stats.totalSize,stats.errorCountandincomplete. - Neither was tried against the real program. The tests use recorded sample answers built from each tool's published API (Backrest's
service.proto, Kopia'sserverapi.go). Duplicati's server API could not be checked from its documentation, so it is not offered. - Alerts:
POST /api/v1/plugin/alertswith the permissionalerts:send, once asraisedand once asclearedfor each key (overdue:<backup>,failed:<backup>). What was raised is kept in/data/raised.json, so a restart sends nothing twice. A Starboard that answers 404 is not asked again for an hour. - The password is read from the settings each time and is never written to
/data, a card or an error. - It starts when needed and stops after 5 minutes with nothing to do.
Find out more
This page on GitHub, where the help is written.