From 4e56c649f74729c77cf35c81bda08394624889c4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 05:08:57 +0000 Subject: [PATCH] Backups: one restic progress line a minute in the log restic shows no progress unless stdout is a terminal, and backup runs log to /proc/1/fd/1, so a day-long first upload was silent from start to finish and read as frozen. RESTIC_PROGRESS_FPS is restic's documented switch for that; 0.0166 is one status line a minute. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XWoa1a1upTria7ntq56x3B --- .env.example | 2 ++ docker-compose.yml | 3 +++ ops/backup/README.md | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/.env.example b/.env.example index 11f42b9..623c21e 100644 --- a/.env.example +++ b/.env.example @@ -161,6 +161,8 @@ BACKUP_SFTP_CONNECTIONS=2 # Optional upload cap in KiB/s for restic and the mirror, e.g. 5000 (about 40 Mbit/s). # Empty = uncapped. Useful while the first upload of a large library runs. BACKUP_LIMIT_UPLOAD_KBPS= +# Progress lines in the backup log, per second: 0.0166 is one a minute. 0 for none. +RESTIC_PROGRESS_FPS=0.0166 BACKUP_CRON_SCHEDULE=0 * * * * BACKUP_KEEP_HOURLY=48 BACKUP_KEEP_DAILY=14 diff --git a/docker-compose.yml b/docker-compose.yml index 645691e..619196a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -90,6 +90,9 @@ services: # Parallel SFTP connections, and an optional upload cap in KiB/s (empty = none). - BACKUP_SFTP_CONNECTIONS=${BACKUP_SFTP_CONNECTIONS:-2} - BACKUP_LIMIT_UPLOAD_KBPS=${BACKUP_LIMIT_UPLOAD_KBPS:-} + # restic shows no progress when its output is a log rather than a terminal, so a + # day-long first upload was silent from start to finish. One status line a minute. + - RESTIC_PROGRESS_FPS=${RESTIC_PROGRESS_FPS:-0.0166} - BACKUP_CRON_SCHEDULE=${BACKUP_CRON_SCHEDULE:-0 * * * *} - BACKUP_KEEP_HOURLY=${BACKUP_KEEP_HOURLY:-48} - BACKUP_KEEP_DAILY=${BACKUP_KEEP_DAILY:-14} diff --git a/ops/backup/README.md b/ops/backup/README.md index 3434720..2a343e1 100644 --- a/ops/backup/README.md +++ b/ops/backup/README.md @@ -424,6 +424,13 @@ repository lock. The first run sends the whole library, which over a home line can take most of a day (restic prints an ETA). Later runs send only what changed, in minutes. +- **The log prints one progress line a minute** (`[1:23:45] 12.34% … files … ETA …`; + `RESTIC_PROGRESS_FPS` in `.env` changes the rate). Between them it is quiet, not + stuck. A `previous run still going, skipping` line from an hourly tick is proof the + run is alive: it is printed only while the run holds its lock. To see how much has + landed on the NAS, `docker compose exec backup rclone size nas:/GeckoNotes/gam/restic` + (your `BACKUP_SFTP_REMOTE_PATH`), a few minutes apart; or watch NET I/O climb in + `docker stats gam-backup-1`. - **If it dies, run the same `exec` line again.** restic saves its index as it goes, so what already reached the NAS is not sent twice; the rerun picks up roughly where the last one stopped. The dead run's leftover repository lock is cleared automatically.