From ab58592523f5e5077481eac289430a90684c15f7 Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 8 Feb 2026 03:56:15 +0300 Subject: [PATCH] Use full restic JSON output --- handlers/backup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/handlers/backup.py b/handlers/backup.py index 994aca4..c9b27c4 100644 --- a/handlers/backup.py +++ b/handlers/backup.py @@ -9,7 +9,7 @@ from keyboards import backup_kb from lock_utils import acquire_lock, release_lock from services.queue import enqueue, format_status, format_details from services.backup import backup_badge, restore_help -from services.runner import run_cmd +from services.runner import run_cmd, run_cmd_full def _parse_systemctl_kv(raw: str) -> dict[str, str]: @@ -80,7 +80,7 @@ async def cmd_repo_stats(msg: Message): await msg.answer("⏳ Loading repo stats…", reply_markup=backup_kb) # --- restore-size stats --- - rc1, raw1 = await run_cmd( + rc1, raw1 = await run_cmd_full( ["restic", "stats", "--json"], use_restic_env=True, timeout=30 @@ -96,7 +96,7 @@ async def cmd_repo_stats(msg: Message): # --- raw-data stats --- - rc2, raw2 = await run_cmd( + rc2, raw2 = await run_cmd_full( ["restic", "stats", "--json", "--mode", "raw-data"], use_restic_env=True, timeout=30 @@ -112,7 +112,7 @@ async def cmd_repo_stats(msg: Message): # --- snapshots count --- - rc3, raw_snaps = await run_cmd( + rc3, raw_snaps = await run_cmd_full( ["restic", "snapshots", "--json"], use_restic_env=True, timeout=20 @@ -141,7 +141,7 @@ async def cmd_backup_status(msg: Message): await msg.answer("⏳ Loading snapshots…", reply_markup=backup_kb) async def worker(): - rc, raw = await run_cmd( + rc, raw = await run_cmd_full( ["restic", "snapshots", "--json"], use_restic_env=True, timeout=30 @@ -213,7 +213,7 @@ async def cmd_last_snapshot(msg: Message): await msg.answer("⏳ Loading last snapshot…", reply_markup=backup_kb) async def worker(): - rc, raw = await run_cmd( + rc, raw = await run_cmd_full( ["restic", "snapshots", "--json"], use_restic_env=True, timeout=20 @@ -235,7 +235,7 @@ async def cmd_last_snapshot(msg: Message): t = datetime.fromisoformat(s["time"].replace("Z", "+00:00")) short_id = s["short_id"] - rc2, raw2 = await run_cmd( + rc2, raw2 = await run_cmd_full( ["restic", "stats", short_id, "--json"], use_restic_env=True, timeout=20