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

borgmatic: expose backup frequency interval #208841

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

InnovativeInventor
Copy link

@InnovativeInventor InnovativeInventor commented Jan 3, 2023

Description of changes

The previous default Borgmatic systemd files defaults to daily backups. This exposes the option to supply a different backup frequency (e.g. hourly).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 3, 2023
@ofborg ofborg bot requested a review from imlonghao January 3, 2023 04:30
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 3, 2023
Copy link
Contributor

@imlonghao imlonghao left a comment

Choose a reason for hiding this comment

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

LGTM

@InnovativeInventor
Copy link
Author

@imlonghao is there something I should do to push this PR along, given that it has been approved?

@SuperSandro2000 SuperSandro2000 added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Jan 23, 2023
The previous default Borgmatic systemd files defaults to daily backups.
This exposes the option to supply a different backup frequency (e.g.
hourly).
@SuperSandro2000 SuperSandro2000 force-pushed the borgmatic-backup-frequency-option branch from 4bafda5 to 4bede23 Compare January 23, 2023 22:32
@ofborg ofborg bot requested a review from imlonghao January 23, 2023 22:54
@InnovativeInventor
Copy link
Author

InnovativeInventor commented Jan 29, 2023

@imlonghao is this waiting on you now? Let me know if there is something I can do to help here.

@NickCao
Copy link
Member

NickCao commented Jan 29, 2023

There are two additional directives in the upstream timer unit that worth handling: Persistent=true and RandomizedDelaySec=3h. They are both useful for backups, persistent allows the timer to be run immediately on next boot if you happen to miss it. While random delay avoids the thundering herd effect of a whole cluster backing up at the same time, stressing the backing storage.

@mweinelt mweinelt removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Feb 1, 2023
@InnovativeInventor
Copy link
Author

There are two additional directives in the upstream timer unit that worth handling: Persistent=true and RandomizedDelaySec=3h. They are both useful for backups, persistent allows the timer to be run immediately on next boot if you happen to miss it. While random delay avoids the thundering herd effect of a whole cluster backing up at the same time, stressing the backing storage.

Ok, what would be the best way for me to add that here? I'm not sure if these options are exposed at the moment.

@NickCao
Copy link
Member

NickCao commented Feb 19, 2023

Ok, what would be the best way for me to add that here? I'm not sure if these options are exposed at the moment.

Maybe properly defining a timer with systemd.timers.borgmatic, the startAt shorthand is really limiting.

@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Copy link
Member

@Janik-Haag Janik-Haag left a comment

Choose a reason for hiding this comment

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

@InnovativeInventor what do you think about @NickCao suggestion of adding a proper sytemd timer? If you need some example you can look at the restic module. what would be your suggestion if you don't like it?

I would love to get this merged and thank you for your contribution, keep them coming ❤️

Comment on lines +17 to +19
Frequency at which borgmatic should be run. See
{manpage}`systemd.time(7)` for
options.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Frequency at which borgmatic should be run. See
{manpage}`systemd.time(7)` for
options.
Frequency at which borgmatic should be run.
See {manpage}`systemd.time(7)` for options.

@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@wegank wegank removed the 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package label Oct 29, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 29, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants