Estimate progress while rsync scans from the last backup's file count

With incremental recursion rsync only knows the total near the end, so the bar showed
no ETA for most of the backup. Save the file count as a third line of the state file
and use it as an estimate until rsync reports the real total.
This commit is contained in:
Fuxino
2026-11-02 20:56:12 +01:00
parent 5e33781974
commit ec27b8d77f
6 changed files with 142 additions and 19 deletions
+1
View File
@@ -64,6 +64,7 @@ The only rsync error that is ignored is return code 24 (source files vanished du
## Last backup
After each successful backup, simple_backup saves its time and directory to `~/.local/state/simple_backup/last_backup` (or `$XDG_STATE_HOME/simple_backup/last_backup`).
It also saves the number of files, so that the next run can show progress and an estimated time while rsync is still looking for files.
When run with sudo or doas, the file goes to the home directory of the user who ran the command.
Print it with: