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

Restic fixes: pruning, process substitution (take 2) #78886

Merged
merged 6 commits into from Feb 7, 2020

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Jan 30, 2020

Motivation for this change

I rebased #44203 and replace some if expressions with optionals/optionalString/optionalAttr.
The result is untested.
cc @jerith666 @bbigras

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

else "--files-from ${filesFromTmpFile}";
pruneCmd = optional (builtins.length backup.pruneOpts > 0) [
( resticCmd + " forget --prune " + (concatStringsSep " " backup.pruneOpts) )
( resticCmd + " check" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure but I think check is not needed when running prune.
Check https://forum.restic.net/t/should-i-run-restic-check/1227

but it seems some people might want to run check --read-data from time to time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the prune command doesn't run because the check one is on the same line in the final systemd service file:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm seeing that missing newline too. I don't understand why, but I see it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't think I'm quite ready to rely on the accepted solution in that forum thread, because of the quote from the docs later on: https://forum.restic.net/t/should-i-run-restic-check/1227/9

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found the problem with the missing newline, see jerith666@dc6616b

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't think I'm quite ready to rely on the accepted solution in that forum thread, because of the quote from the docs later on: https://forum.restic.net/t/should-i-run-restic-check/1227/9

Yeah that's weird. fd0 is the main dev so we are supposed to be able to trust him. But he didn't bother to reply on the last comment.

Maybe we should ask him. It would be a shame to run an expansive operation like check daily until the next release.

Copy link
Contributor

@bbigras bbigras Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test passes with jerith666@dc6616b .

Do you think it would be a good idea to make running restic check optional for now? And figure out the true best practices from the upstream dev later.

EDIT: check is already optional. If I think it's running to often I can disable pruning and do it myself.

@bbigras
Copy link
Contributor

bbigras commented Jan 30, 2020

I have a nixos test for the prune part: bbigras@a772ab6

Feel free to include it in this PR, otherwise I'll try to get it merged later.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixos-20-03-feature-freeze/5655/8

@bbigras
Copy link
Contributor

bbigras commented Feb 5, 2020

Can you add jerith666@dc6616b to this PR please?

@Mic92
Copy link
Member Author

Mic92 commented Feb 7, 2020

@GrahamcOfBorg test restic

@Mic92
Copy link
Member Author

Mic92 commented Feb 7, 2020

@GrahamcOfBorg test restic

@Mic92
Copy link
Member Author

Mic92 commented Feb 7, 2020

@GrahamcOfBorg test restic

@Mic92 Mic92 merged commit 341241b into NixOS:master Feb 7, 2020
@Mic92 Mic92 deleted the restic-fixes branch February 7, 2020 14:14
@bbigras
Copy link
Contributor

bbigras commented Feb 7, 2020

thanks @Mic92 ❤️

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants