Simplify backup menu and remove last backup

This commit is contained in:
2026-02-07 22:40:51 +03:00
parent 60f38c8965
commit 86fe88e464
3 changed files with 4 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
from datetime import datetime, timezone
from typing import Optional
import json
import subprocess
from services.runner import run_cmd
@@ -33,23 +32,6 @@ async def get_last_snapshot() -> Optional[dict]:
return snaps[0]
def last_backup() -> str:
out = subprocess.check_output(
["restic", "snapshots", "--json"],
env=None
).decode()
snaps = json.loads(out)
snaps.sort(key=lambda s: s["time"], reverse=True)
s = snaps[0]
t = datetime.fromisoformat(s["time"].replace("Z", ""))
return (
"📦 Last backup\n\n"
f"🕒 {t:%Y-%m-%d %H:%M}\n"
f"🧉 ID: {s['short_id']}\n"
f"📁 Paths: {len(s['paths'])}"
)
def restore_help() -> str:
return (
"🧯 Restore help\n\n"