fix timing

This commit is contained in:
2025-10-18 14:01:34 -05:00
parent 643ab0958c
commit eef0c8cf27
2 changed files with 24 additions and 23 deletions

View File

@@ -135,26 +135,24 @@ in {
};
# backups minecraft_recpro with borg!
services.borgbackup.jobs.${service} =
lib.mapAttrs (name: srv: {
archiveBaseName = "${name}";
repo = cfg.backup_repo;
paths = [srv.data_dir] ++ lib.optionals (srv ? db_dump_dir) [srv.db_path];
compression = "auto,zstd";
startAt = "*-*-* *:00:00";
group = "archives";
encryption.mode = "repokey-blake2";
encryption.passCommand = "cat ${config.sops.secrets."borg_passwd".path}";
extraArgs = ["--verbose" "--show-rc" "--umask" "0007"];
extraCreateArgs = ["--list" "--stats" "--filter" "AME"];
prune.keep = {
within = "1d"; # Keep all archives from the last day
hourly = 24;
daily = 7;
weekly = 12;
monthly = -1; # Keep at least one archive for each month
};
})
servers;
services.borgbackup.jobs.${service} = {
archiveBaseName = service;
repo = cfg.backup_repo;
paths = lib.flatten (lib.attrValues (lib.mapAttrs (_: srv: [srv.data_dir]) servers));
compression = "auto,zstd";
startAt = "*-*-* *:00:00";
group = "archives";
encryption.mode = "repokey-blake2";
encryption.passCommand = "cat ${config.sops.secrets."borg_passwd".path}";
extraArgs = ["--verbose" "--show-rc" "--umask" "0007"];
extraCreateArgs = ["--list" "--stats" "--filter" "AME"];
prune.keep = {
within = "1d"; # Keep all archives from the last day
hourly = 24;
daily = 7;
weekly = 12;
monthly = -1; # Keep at least one archive for each month
};
};
};
}

View File

@@ -64,7 +64,7 @@ in {
enable = true;
location = "/var/backup/mysql";
user = "root";
calendar = "*-*-* *:59:00";
calendar = "*-*-* *:59:50";
compressionAlg = "zstd";
databases = config.services.mysql.ensureDatabases; # set to all databases defined in esure databases
};
@@ -73,11 +73,14 @@ in {
enable = true;
location = "/var/backup/postgresql";
compression = "zstd"; # optional: "xz", "zstd", "none"
startAt = "03:58";
startAt = "03:59";
databases = ["immich"]; # set to all databases defined in esure databases
#databases = config.services.postgresql.ensureDatabases; # set to all databases defined in esure databases
};
# helpful
environment.systemPackages = with pkgs; [borgbackup tree];
# declare secret for repo password
sops.secrets = {
"borg_passwd" = {