restic: add daily external backups of all safe/backups
This commit is contained in:
parent
d4d8236501
commit
3a0792caec
7 changed files with 64 additions and 1 deletions
30
shared/applications/server/restic.nix
Normal file
30
shared/applications/server/restic.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
services.restic = {
|
||||
# enable = true;
|
||||
|
||||
backups.main = {
|
||||
repository = "b2:situla-${config.mine.shared.settings.brand_lower}:.";
|
||||
|
||||
passwordFile = config.age.secrets."restic-pass".path;
|
||||
environmentFile = config.age.secrets."restic-env".path;
|
||||
|
||||
# take all `.*/safe/.*` and `.*/backup/.*` zfs volumes
|
||||
paths = let
|
||||
backupPaths = lib.filterAttrs (n: _:
|
||||
(lib.hasInfix "/safe/" n) || (lib.hasInfix "/backup/" n)
|
||||
) config.mine.zfsMounts;
|
||||
in lib.attrValues backupPaths;
|
||||
|
||||
initialize = true;
|
||||
runCheck = true;
|
||||
pruneOpts = [
|
||||
"--keep-last 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 6"
|
||||
"--keep-yearly 2"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue