Duplicati: flag warnings run after run, and forecast how much room backups take

A job whose last three runs in a row all finished with warnings is flagged and
raises an alert (on by default, switchable off per job). The size of the
destination, and its quota where the storage says, are read from the reports
and kept with each run; the Stored column shows the growth and, where the room
is known, when it will be full, with an alert inside the disk-forecast window.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-12 23:19:54 +01:00
1 parent 333146e8e3
commit 4f077d4f4a
15 files changed
+10115 -14

No files matched your search

+16 -1
View File
@@ -2178,6 +2178,15 @@ export interface DuplicatiBackup {
alert: boolean;
/** Raise an alert when the last run finished with warnings. */
alertWarnings: boolean;
/** Raise an alert when the last few runs in a row all finished with warnings. */
warnStreakAlert: boolean;
/** How many of the newest runs in a row finished with warnings. */
warningStreak: number;
/** How much the backups take up where they are kept, and the room there when its storage says; null: the reports do not say. */
destinationBytes: number | null;
quotaBytes: number | null;
/** How that has grown (null without enough history); daysToFull only where the room is known. */
growth: { perDay: number; perMonth: number; fit: number; spanDays: number; latest: number; daysToFull: number | null } | null;
}
export interface DuplicatiSource {
@@ -2209,6 +2218,10 @@ export interface DuplicatiOverview {
backups: DuplicatiBackup[];
servers: { id: number; name: string }[];
defaultExpectedHours: number;
/** How many runs in a row with warnings is flagged. */
streakRuns: number;
/** How many days ahead a filling destination is flagged (the disk forecast window; 0 = off). */
forecastDays: number;
}
export interface DuplicatiRun {
@@ -2222,6 +2235,8 @@ export interface DuplicatiRun {
errors: number;
/** What this run's warnings said (up to 20). */
warningMessages: string[];
/** How much the backups took up where they are kept after this run, when the report said. */
destinationBytes: number | null;
}
export interface EndpointSuggestion {
@@ -3784,7 +3799,7 @@ export const api = {
runs: (backupId: number) => request<{ backup: { id: number; name: string }; runs: DuplicatiRun[] }>(`/api/duplicati/backups/${backupId}/runs`),
addSource: (data: { name: string; serverId: number | null }) => request<{ source: DuplicatiSource; token: string; path: string }>("/api/duplicati/sources", { method: "POST", body: JSON.stringify(data) }),
removeSource: (id: number) => request<void>(`/api/duplicati/sources/${id}`, { method: "DELETE" }),
updateBackup: (id: number, data: { expectedHours?: number; alert?: boolean; alertWarnings?: boolean }) => request<{ ok: boolean }>(`/api/duplicati/backups/${id}`, { method: "PATCH", body: JSON.stringify(data) }),
updateBackup: (id: number, data: { expectedHours?: number; alert?: boolean; alertWarnings?: boolean; warnStreakAlert?: boolean }) => request<{ ok: boolean }>(`/api/duplicati/backups/${id}`, { method: "PATCH", body: JSON.stringify(data) }),
forgetBackup: (id: number) => request<void>(`/api/duplicati/backups/${id}`, { method: "DELETE" }),
},
away: {
+13
View File
@@ -43,6 +43,8 @@ export const sv: Record<string, string> = {
"{shown} of {total}": "{shown} av {total}",
"{value} now": "{value} nu",
"← Prev": "← Föregående",
"+{size} a month": "+{size} i månaden",
"−{size} a month": "−{size} i månaden",
"1 hour": "1 timme",
"1 year": "1 år",
"2 hours": "2 timmar",
@@ -107,6 +109,7 @@ export const sv: Record<string, string> = {
"Agents to update": "Agenter att uppdatera",
"Alert at (%)": "Larma vid (%)",
"Alert limits": "Larmgränser",
"Alert on streaks": "Larma om varningar i rad",
"Alert settings": "Larminställningar",
"Alerts": "Larm",
"Alerts for this server are silenced (a maintenance window).": "Larm för den här servern tystas (ett underhållsfönster).",
@@ -267,6 +270,7 @@ export const sv: Record<string, string> = {
"Fold the cards you do not need and put the others in the order you like — for every server": "Fäll ihop korten du inte behöver och lägg de andra i den ordning du vill — för alla servrar",
"Follow Settings again": "Följ Inställningar igen",
"From now": "Från nu",
"full in about {n} days": "full om cirka {n} dagar",
"Full screen": "Helskärm",
"Further ahead": "Längre fram",
"Game servers": "Spelservrar",
@@ -290,6 +294,8 @@ export const sv: Record<string, string> = {
"Homelab Manager waits for the server to report again — it may be restarting.": "Homelab Manager väntar på att servern ska rapportera igen — den kanske startar om.",
"Hostname": "Värdnamn",
"How far ahead": "Hur långt framåt",
"How much the backups take up where they are kept": "Hur mycket säkerhetskopiorna tar där de förvaras",
"How much the backups take up where they are kept, and how that is growing": "Hur mycket säkerhetskopiorna tar där de förvaras, och hur det växer",
"How this server is": "Hur servern mår",
"How tightly pages are packed": "Hur tätt sidorna packas",
"How to show the integrations": "Hur integrationerna visas",
@@ -422,6 +428,7 @@ export const sv: Record<string, string> = {
"Not configured": "Inte konfigurerad",
"Not connected": "Inte ansluten",
"Not done yet": "Inte klart än",
"not growing": "växer inte",
"Not read yet": "Inte läst än",
"Not read yet.": "Inte läst än.",
"not reported": "ej rapporterat",
@@ -459,6 +466,7 @@ export const sv: Record<string, string> = {
"Nothing with a date fits the kinds and server chosen. Try a longer range, or fewer filters.": "Inget med ett datum passar de valda sorterna och servern. Prova en längre period, eller färre filter.",
"Notifications": "Notiser",
"Notifications are held": "Notiser hålls tillbaka",
"of {total}": "av {total}",
"Offline": "Offline",
"Offline:": "Offline:",
"OK": "OK",
@@ -600,6 +608,7 @@ export const sv: Record<string, string> = {
"Silence…": "Tysta…",
"Silenced for the target": "Tystad för målet",
"Since you last looked": "Sedan du senast tittade",
"size goes up and down": "storleken går upp och ned",
"Skip to content": "Hoppa till innehållet",
"Snooze…": "Påminn senare…",
"Somebody is watching.": "Någon tittar.",
@@ -619,9 +628,11 @@ export const sv: Record<string, string> = {
"Stop following": "Sluta följa",
"Stop following this run?": "Sluta följa den här körningen?",
"Stop server": "Stoppa server",
"Stop streak alerts": "Sluta larma om varningar i rad",
"stopped being followed": "följs inte längre",
"stopping": "stoppar",
"Storage, volume and disk-health alerts (for a Proxmox or Synology integration).": "Larm om lagring, volymer och diskhälsa (för en Proxmox- eller Synology-integration).",
"Stored": "Lagrat",
"Sundays at 02:00, the servers tagged lab, one at a time, stop at the first failure.": "Söndagar 02:00, servrarna taggade lab, en i taget, stanna vid första misslyckandet.",
"Switched off": "Avstängd",
"Switched off under Integrations.": "Avstängd under Integrationer.",
@@ -693,6 +704,7 @@ export const sv: Record<string, string> = {
"Wall display": "Väggskärm",
"Wall displays": "Väggdisplayer",
"Warning": "Varning",
"Warnings {n} runs in a row": "Varningar {n} körningar i rad",
"Welcome back,": "Välkommen tillbaka,",
"What are you working on?": "Vad jobbar du med?",
"What gets silenced": "Vad som tystas",
@@ -706,6 +718,7 @@ export const sv: Record<string, string> = {
"When the acknowledgement runs out and the alert counts as nobody's again": "När kvitteringen går ut och larmet åter räknas som ingens",
"When you acknowledge an alert, are handed one, put something under maintenance or start an update run, it is listed here until it is done.": "När du kvitterar ett larm, får ett tilldelat, sätter något under underhåll eller startar en uppdateringskörning listas det här tills det är klart.",
"Where": "Var",
"Whether {n} runs in a row with warnings raise an alert (on unless you switch it off; a job that always has a few warnings can be left alone)": "Om {n} körningar i rad med varningar ger ett larm (på om du inte stänger av det; ett jobb som alltid har några varningar kan lämnas ifred)",
"Whether somebody is on it": "Om någon jobbar med det",
"Which display": "Vilken display",
"Which servers": "Vilka servrar",
+31 -1
View File
@@ -89,6 +89,7 @@ function History({ backup, onClose }: { backup: DuplicatiBackup; onClose: () =>
<th>Result</th>
<th className="text-end">Took</th>
<th className="text-end">Size</th>
<th className="text-end" title={t("How much the backups take up where they are kept")}>{t("Stored")}</th>
<th className="text-end">Changed</th>
</tr>
</thead>
@@ -109,6 +110,7 @@ function History({ backup, onClose }: { backup: DuplicatiBackup; onClose: () =>
</td>
<td className="text-end">{took(r.durationSeconds)}</td>
<td className="text-end">{r.sizeBytes === null ? "—" : formatBytes(r.sizeBytes)}</td>
<td className="text-end">{r.destinationBytes === null ? "—" : formatBytes(r.destinationBytes)}</td>
<td className="text-end">{r.filesChanged === null ? "—" : r.filesChanged.toLocaleString()}</td>
</tr>
))}
@@ -157,6 +159,26 @@ function Activity({ s }: { s: DuplicatiSource }) {
);
}
/**
* How much a backup takes up where it is kept, and — once there is enough history to say — how that is growing: "+3.4 GB a month", "not growing", and, where the storage says how much room it has,
* how long until it is full. Nothing is claimed from too little history.
*/
function stored(b: DuplicatiBackup, forecastDays: number) {
if (b.destinationBytes === null) return <span className="text-secondary">—</span>;
const g = b.growth;
const small = g !== null && Math.abs(g.perMonth) < Math.max(b.destinationBytes * 0.005, 1e6);
return (
<>
{formatBytes(b.destinationBytes)}
{b.quotaBytes !== null && <span className="text-secondary small"> {t("of {total}", { total: formatBytes(b.quotaBytes) })}</span>}
{g && g.fit >= 0.8 && !small && <div className="text-secondary small">{g.perMonth > 0 ? t("+{size} a month", { size: formatBytes(g.perMonth) }) : t("−{size} a month", { size: formatBytes(-g.perMonth) })}</div>}
{g && small && <div className="text-secondary small">{t("not growing")}</div>}
{g && g.fit < 0.8 && !small && <div className="text-secondary small">{t("size goes up and down")}</div>}
{g && g.daysToFull !== null && g.fit >= 0.8 && <div className={g.daysToFull <= forecastDays ? "text-red small" : "text-secondary small"}>{t("full in about {n} days", { n: g.daysToFull })}</div>}
</>
);
}
/** What to paste into Duplicati, shown once after a machine is added. */
function Address({ path, name, onDone }: { path: string; name: string; onDone: () => void }) {
const url = `${window.location.origin}${path}`;
@@ -238,7 +260,7 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
}
}
async function patch(b: DuplicatiBackup, change: { expectedHours?: number; alert?: boolean; alertWarnings?: boolean }) {
async function patch(b: DuplicatiBackup, change: { expectedHours?: number; alert?: boolean; alertWarnings?: boolean; warnStreakAlert?: boolean }) {
try {
await api.duplicati.updateBackup(b.id, change);
load();
@@ -377,6 +399,7 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
<th>Last good backup</th>
<th className="text-end">Took</th>
<th className="text-end">Size</th>
<th className="text-end" title={t("How much the backups take up where they are kept, and how that is growing")}>{t("Stored")}</th>
<th className="text-end">Changed</th>
<th>Expected every</th>
<th>State</th>
@@ -400,6 +423,7 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
</td>
<td className="text-end">{took(b.durationSeconds)}</td>
<td className="text-end">{b.sizeBytes === null ? "—" : formatBytes(b.sizeBytes)}</td>
<td className="text-end">{stored(b, data.forecastDays)}</td>
<td className="text-end">{b.addedFiles === null && b.modifiedFiles === null && b.deletedFiles === null ? "—" : ((b.addedFiles ?? 0) + (b.modifiedFiles ?? 0) + (b.deletedFiles ?? 0)).toLocaleString()}</td>
<td>
{canEdit ? (
@@ -420,6 +444,7 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
{b.problem && <div className="text-secondary small">{b.problem}</div>}
{b.state === "warning" && !b.problem && <Warnings count={b.warnings} messages={b.warningMessages} label={`${b.warnings} warning${b.warnings === 1 ? "" : "s"} in the last run`} />}
{b.problem && b.state === "warning" && <Warnings count={b.warnings} messages={b.warningMessages} label="All the warnings" />}
{b.warningStreak >= data.streakRuns && <div className="text-yellow small">{t("Warnings {n} runs in a row", { n: b.warningStreak })}</div>}
{!b.alert && <div className="text-secondary small">no alert</div>}
{b.alert && b.alertWarnings && <div className="text-secondary small">alerts on warnings</div>}
</td>
@@ -433,6 +458,11 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
<button className="btn btn-sm btn-outline-secondary" onClick={() => void patch(b, { alert: !b.alert })}>
{b.alert ? "Mute" : "Alert"}
</button>
{b.alert && !b.alertWarnings && (
<button className="btn btn-sm btn-outline-secondary" onClick={() => void patch(b, { warnStreakAlert: !b.warnStreakAlert })} title={t("Whether {n} runs in a row with warnings raise an alert (on unless you switch it off; a job that always has a few warnings can be left alone)", { n: data.streakRuns })}>
{b.warnStreakAlert ? t("Stop streak alerts") : t("Alert on streaks")}
</button>
)}
{b.alert && (
<button className="btn btn-sm btn-outline-secondary" onClick={() => void patch(b, { alertWarnings: !b.alertWarnings })} title="Whether a run that finishes with warnings raises an alert (it counts as a good backup either way)">
{b.alertWarnings ? "Stop warning alerts" : "Alert on warnings"}