Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support restic check #75

Closed
SiddharthManthan opened this issue Feb 8, 2024 · 5 comments
Closed

Support restic check #75

SiddharthManthan opened this issue Feb 8, 2024 · 5 comments
Labels
enhancement New feature or request p2

Comments

@SiddharthManthan
Copy link

SiddharthManthan commented Feb 8, 2024

Add support to check the repo.

The following checks are available :

  • Repo Integrity
  • Packfile Integrity
    • Full check --read-data
    • Specified subset of repo --read-data-subset=n/t
    • Random subset of repo
      • Random subset by percent --read-data-subset=x%
      • Random subset by size --read-data-subset=nS

The existing plans can be classified into backup plan and check plan. Check plan can be scheduled similar to backup plans.

This could be considered a high priority issue since repo can be corrupted due to updates or existing undiscovered bugs (eg : recent compression bug). If repo corruption is known soon, it can rectified.

@garethgeorge garethgeorge added enhancement New feature or request p2 labels Feb 8, 2024
@MarvinJWendt
Copy link
Contributor

MarvinJWendt commented Mar 24, 2024

+1 from me.

Personally, I would like a Check now button, next to the Backup now one.

Also some repo configuration that would make sense:

  • Check schedule (CRON like schedule for checking the repo automatically)
  • Scheduled check percentage (applied to each scheduled check)
  • Manuel check percentage (applied to each manual check, e.g.: click on Check now)

Thinking about it, maybe it would make sense to have a dropdown button next to Backup now with "More actions".

image

Maybe it would also make sense to move Unlock repo and Prune now there.
That way, we could also have a button Full check now without bloating the UI.


Note: as a new restic user, who used backrest to back up multiple hosts with multiple TB of data, I would be very interested in seeing that a backup is restorable. Having an indicator in the UI that shows something like "Check: OK {timestamp}" would make it easy to spot corrupted backups. Also, this could be combined with notifications, when a corrupted backup is detected. Or if backrest wants to go so far, maybe even automatic fixing of corrupted backups (as I am new to restic, I am not sure if it provides functionality for repairing corrupted chunks after a failed check, I'll leave that to the pros)

@garethgeorge
Copy link
Owner

Hey, thanks all for the interest. Just updating here to say that this is high on the todo list. I like the idea of a "check now" button at the very least and will aim to make automatic checks configurable. I think the right time to run them is probably right after a prune operation.

@lakemike
Copy link

Coincidentally, I just had issues with one my repositories.

  • This was identified by an automated "prune" run.
  • Running "check" at commandn line confirmed there is an issue.
  • A combination of "repair index" and "repair snapshots --forget" was effective in fixing it.

Just looking at this case, these enhancements could be very useful

  • "check now" button
  • option to run checks in a scheduled fashion or, alternatively, always after prune
  • "more actions" button, e.g. "repair index", "repair packs", "repair snapshots"

@garethgeorge
Copy link
Owner

garethgeorge commented May 27, 2024

Initial implementation in PR #303 , a preview release with check support can be downloaded from https://github.com/garethgeorge/backrest/actions/runs/9260231928 .

Check is introduced as a new type of scheduled task (similar to prune) with new hooks introduced to make it's output actionable:

  • CONDITION_CHECK_START
  • CONDITION_CHECK_ERROR
  • CONDITION_CHECK_SUCCESS

Similar hooks were also added for prune for consistency.

@garethgeorge
Copy link
Owner

Available in version 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p2
Projects
None yet
Development

No branches or pull requests

4 participants