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

add minAge setting to nixos borgbackup options #85696

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ToxicFrog
Copy link
Contributor

Motivation for this change

Not all the systems I back up are online all the time, so I like to run multiple backups per day in the hopes of catching them when they're online, but not bother backing them up if there's already a recent backup. This change adds a minAge setting to borgbackup configuration; the backups will be checked with the configured frequency, but skip actually performing the backup if there's one for the same prefix more recent than minAge.

I've been using this feature on my server for about a year now.

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.

@ToxicFrog ToxicFrog changed the title Borgbackup min age add minAge setting to nixos borgbackup options Apr 21, 2020
@Lassulus
Copy link
Member

also here (as in #85697), please use a different commit message to add yourself to the maintainers :)

@ToxicFrog
Copy link
Contributor Author

also here (as in #85697), please use a different commit message to add yourself to the maintainers :)

Done.

@@ -42,6 +42,24 @@ let
${cfg.postInit}
fi
'' + ''
# Check if the backup is old enough.
now=$(date +%s)
Copy link
Member

Choose a reason for hiding this comment

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

maybe we could add the check only if minAge != 0?

@stale
Copy link

stale bot commented Mar 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 16, 2021
@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 marked this pull request as draft March 25, 2024 16:19
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