Repository navigation
Fixes from the project review, and a new Keep versions rule - #4
Merged
Merged
Conversation
…port copy limits A robocopy log without totals is a failed run. Each selected folder has its own log. A file and a folder that swapped kinds heal by moving the old item to the dated recovery folder. -Repair copies again what the last content check found different. Short-name skips and case collisions are reported. The same-disk guard works in both directions. Tests run in a temporary folder (-TestRoot). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A backup that could not read every file is tagged as partial and never counted or deleted by Keep versions. A lock left by a run that ended is removed only when it was made on this computer and its process is gone; the step is retried once. Clean-up is limited to this computer, deletes in batches, and restore below protected folders reports that content was not verified. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Starting twice brings the open window forward. A damaged settings file can be restored from the last good copy and is always kept. The overview warns when the latest run failed. Runs are recorded as failed, stopped or unknown instead of a wrong success. The window refreshes itself, explains disabled buttons and offers Repair. Tests open the window off-screen (-Quiet). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Controller resets count only for the drive's own connection. A new scan keeps the last scan's bad areas. Parts that were not checked are not reported as fine. The health tool's drive database is pinned and a stray library stops it. The privacy check reads UTF-16, checks every pushed commit and finds long values inside words. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…sturdier test clean-up -PreviewRecovery names the recovery folders the keep rule would delete and deletes none, for the window's first-clean-up approval. The test's own tidying up removes its junctions one by one and no longer fails a passed run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A step that dot-sources a test ends with the exit code of the last program the test ran (robocopy returns 1 after copying), so a passed test failed its step. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…en the engine is missing Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…er and folder set The plan is computed by Get-VersionRetentionPlan and re-checked before deletion; restic only lists and deletes by exact ID. Partial versions never count and go once three complete versions of the same group are newer. -RetentionPreview plans only. The result names the deleted versions and reports no freed size. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…before the first clean-up Old day/week/month settings that deleted versions become 10 and 6 after a copy of the settings file is written. Until the first clean-up is approved, backups only list what would be deleted; the list is offered after a backup of every source that finished without errors. Keep deleted is labelled by recovery folders. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…he engine installed Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…g repository stops the backup -RetentionApprovedFile narrows one clean-up to the listed IDs that the plan still wants deleted and reports what was deferred. A versions folder that is gone is never recreated without -CreateNewRepository. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…a drive lost during a scan -RecoveryApproved deletes only listed recovery folders. Files in use are named; the run stays failed, but the first full check is remembered apart from a complete backup and forgotten when any real difference is found. A scan that loses the drive ends as not completed. Unmatched log entries are a note. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… settings changed on disk Approval stores exactly what was shown and the next backup deletes only that. The window suggests a keep rule, offers to exclude a file in use three times, asks before creating a new versions folder and when a folder is added again, can shrink to 80%, and never overwrites a settings file damaged or changed on disk. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… variables Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ext run On a slow computer the run that follows a killed backup could start while the killed process still existed; its lock is then rightly left alone and the test failed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…esses to be gone The hosted runner's screen is smaller than the window at full size, so Windows cut the test window down and three size checks failed. The workflow sets a larger resolution and the test says so plainly on a small screen. The kill tests wait until Windows no longer knows the killed engine processes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A lock is released only when its process is gone. On a busy computer Windows can hand the ended process's number to a new program at once; the lock is then rightly kept, and the two kill tests failed now and then. They now wait until Windows no longer knows the killed processes and report that case as skipped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d two fixes - A lock whose process number Windows gave to another program: the judgement is now checked every run against real running programs (Get-LockProcess moved to Backup.History.psm1). When the kill test meets a taken number it checks the outcome (lock kept with a plain message, or removed once free) instead of only skipping. - Keep versions: one version dated far ahead by a wrong clock no longer moves every month out of the monthly rule; the months ending with the version just made count too. - Continuing an earlier backup of a folder added again has the first clean-up shown for approval again; its old versions and recovery folders were deleted unseen on a drive whose clean-up already ran by the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tool's newest complete version - The question before the first clean-up has "Show the full list": every version (with its ID) and recovery folder it would delete, in a window that can be scrolled and copied. Approving stores that same list. - Deletion by hand also protects the newest complete version this tool made of each computer and set of folders as the clean-up groups them, so a newer version of another program or the same folder in other capital letters no longer leaves it unprotected. - Tests can answer several questions in a row (-Answer 'A>B'). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ait is judged by the run itself The kill test met a number that Windows gave to another program right after it had waited for the old process to go. The next run decides now: the lock is removed with the usual checks, or it is kept, nothing is removed and the message names the number in use. Anything else fails and prints the result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…umber match Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ttons stay on the screen A hand check of the clean-up question with long folder names found its buttons below the bottom edge of the screen. The text now scrolls in a box of the height that fits. 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.
Fixes from a review of the whole project, plus the behaviour changes that were decided along the way. Every fix has a test that showed the fault first. Not merged on purpose: please review before merging.
What was wrong and is fixed
Wrong success, missing backup, data loss
Deletion that was not approved (found in the last round)
Plain copy:
-Repaircopies again what the last content check found different, keeping each old version; files skipped through a short Windows name, names that differ only by case, and files in use are named in the result; the same-disk guard works in both directions.Versions: restore below protected folders says plainly that content was not verified; deletion in batches; an interrupted password change can resume after the drive letter changed; clean-up limited to this computer; a missing versions folder stops the backup instead of quietly starting an empty one.
Window: one window at a time; a damaged settings file can be restored from the last good copy and is never overwritten, also when it was damaged or edited while the window was open; the overview warns when the latest run failed; buttons that are off say why; the window refreshes itself and can shrink to 80%.
Drive check and privacy check: a controller reset counts only for the drive's own connection; a new scan keeps the last scan's bad areas; parts that were not checked are not reported as fine; a scan that loses the drive ends as not completed; the privacy check reads UTF-16, checks every pushed commit and finds long values inside words.
Keep versions: new rule
The newest N complete versions, whatever their dates, plus the newest complete version of each calendar month for M months, for each computer and set of folders (10 and 6 by default; up to 16 complete versions per group, usually 15, while the clock is right). A partial version is deleted once three complete versions of the same group are newer, which can remove content that exists only in it. Earlier day/week/month settings that deleted versions become 10 and 6, after a copy of the settings file is written.
Nothing is deleted before the first clean-up is approved: backups list what would go, the window asks once after a backup of every source that finished without errors, and that first clean-up deletes only what was listed. After that it runs by the rule. Changing the numbers, or continuing an earlier backup of a folder, asks again.
Decided during review (approved)
profiles.changed-<time>.local.json, the window's settings are saved, and the status line names the copy.Excludename with a wildcard can still skip files through their short Windows name; they are now named, not copied.Locks when Windows reuses a process number
When the process that made a lock has ended and Windows already gave its number to another program, the worker judges the lock ended, but restic keeps it until it is 30 minutes old; the run fails with that time in its message, and a later run removes it.
Test-BackupVersionsRules.ps1checks this judgement against real running programs on every run. The kill test inTest-BackupVersions.ps1cannot cause a reused number, but when it meets one (before its wait ends, or just after) the next run decides: the lock is removed with the usual checks, or it is kept, nothing is removed and the message names the number in use. Anything else fails and prints the run's result. CI met this case several times.How it was tested
Not verified / known limits
Test-DevDriveBackup,Test-BackupSelection,Test-BackupSystem,Test-BackupSecurity) were not run; two were edited and only parse-checked.smartctlwas compared with the official smartmontools 7.5 source archive: identical except the version line and the line ends of the Windows build. The pinned checksum is that of the installed Windows file; it was not re-derived by unpacking the installer.🤖 Generated with Claude Code