Repository navigation
Honest speed and time left while a backup runs, and in Recent runs - #5
Merged
Merged
Conversation
…not from free space The status line guessed the copy speed from how fast the backup drive's free space shrank. That jumps when robocopy sets a file's size before writing it, stays at zero while unchanged files are compared, and says nothing true for versions, which write only compressed new data. The time left came only from restic's own guess, rounded up to whole minutes: on a real run it said one or two minutes when 10 to 25 seconds were left. - Plain copy: files and bytes copied are read from robocopy's own log records, only the new part every 2 seconds; the speed is over the last 10 seconds. - Versions: "Counting files" until restic has counted them all, then "N of M files checked". - Time left: the usual length of the step (the middle of its last three runs that went through), blended with the tool's own guess by how far it is, plus the usual length of the steps still waiting. "Taking longer than usual" when there is nothing left to go by. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…versions show none The Speed column divided what was copied by the length of the whole run. Most of a plain copy is comparing files that did not change and moving deleted ones aside, so a copy made at about 140 MB/s showed 7 MB/s. Versions divided what restic went through by the run's length, but restic passes most files by size and date without reading them, so 397 MB/s was no speed either. - Invoke-FastMirror times each robocopy run (Seconds in summary.Runs); robocopy's own Times add up every thread under /MT. - Complete-CenterStep records CopySeconds: the time of the runs that copied something, unknown when one of them has no time or no readable bytes. - Get-CenterRunSpeed: a plain copy's speed is CopiedBytes / CopySeconds; versions, checks, repairs and entries from before this show none. - The Help page says what the speed means. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A real backup on 2026-11-18 finished fine, but the numbers on screen were wrong:
What changed
Status line of a running backup (
DevDriveBackup.ps1Update-RunStatus, new helpers inDevDriveBackup.Data.psm1)Speed in Recent runs (
Invoke-FastMirror.ps1,Get-CenterRunSpeed,Complete-CenterStep)Secondsinsummary.Runs); robocopy's own Times add up every thread under /MT.CopySeconds: the time of the runs that copied something.For the reviewer
Get-CenterFreeBytesstays (Get-CenterDrive uses it); it is no longer used for speed.[math]::Max(0, fraction)calls had to take[double]0: with an int first argument PowerShell picks the integer overload and rounds the fraction to 0.Tests
Test-BackupData.ps1: 306 pass (new checks for log counting, partial lines, run-folder choice, rate window, usual length, time left, copy time and speed)Test-BackupWindow.ps1: 96 passTest-BackupMirror.ps1: 171 passTest-BackupStyle.ps1: pass🤖 Generated with Claude Code