From 0620f199b2f62c9adbc2be3b9387a2be1df85ea4 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 30 Jul 2024 11:41:38 +0800 Subject: [PATCH] feat: update btrbk configs --- modules/nixos/base/btrbk.nix | 2 +- modules/nixos/server/kubevirt-hardware-configuration.nix | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/nixos/base/btrbk.nix b/modules/nixos/base/btrbk.nix index 62718223..181e1190 100644 --- a/modules/nixos/base/btrbk.nix +++ b/modules/nixos/base/btrbk.nix @@ -18,7 +18,7 @@ services.btrbk.instances.btrbk = { # How often this btrbk instance is started. See systemd.time(7) for more information about the format. - onCalendar = "Tue,Fri,Sat,Sun *-*-* 3:45:20"; # daily at 3:45, except on Monday, Wednesday, and Thursday + onCalendar = "Tue,Thu,Sat *-*-* 3:45:20"; settings = { # how to prune local snapshots: # 1. keep daily snapshots for xx days diff --git a/modules/nixos/server/kubevirt-hardware-configuration.nix b/modules/nixos/server/kubevirt-hardware-configuration.nix index 84d4832f..4a9c02ef 100644 --- a/modules/nixos/server/kubevirt-hardware-configuration.nix +++ b/modules/nixos/server/kubevirt-hardware-configuration.nix @@ -18,6 +18,12 @@ "${toString modulesPath}/profiles/qemu-guest.nix" ]; + # backup only once a week inside all virtual machines + services.btrbk.instances.btrbk = { + onCalendar = lib.mkForce "Wed *-*-* 5:25:20"; + settings.snapshot_preserve = lib.mkForce "7d"; + }; + config = { fileSystems."/" = { device = "/dev/disk/by-label/nixos";