database backup refining

This commit is contained in:
2025-10-17 20:03:56 -05:00
parent 6d3ae434a5
commit 06ec73de0b
3 changed files with 6 additions and 9 deletions

View File

@@ -109,7 +109,7 @@ in {
# add to backups
system.backups.baks = {
${service} = {paths = [cfg.data_dir "/var/lib/redis-immich"];};
${service} = {paths = [cfg.data_dir "/var/lib/redis-immich" "/var/backups/postgresql/immich.sql.zst"];};
};
};
}

View File

@@ -117,7 +117,7 @@ in
lib.mapAttrsToList (srv_name: cfg:
{
name = srv_name; # attribute key
value = { paths = [ cfg.data_dir ]; }; # attribute value
value = { paths = [ cfg.data_dir "/var/backups/${service}_db.zst" ]; }; # attribute value
}
) servers
);

View File

@@ -160,23 +160,20 @@ in {
enable = true;
location = "/var/backup/mysql";
user = "root";
startAt = "03:58";
compression = "zstd";
calendar = "03:58:00";
compressionAlg = "zstd";
databases = config.services.mysql.ensureDatabases; # set to all databases defined in esure databases
};
services.postgresqlBackup = config.services.postgresql.enable {
services.postgresqlBackup = lib.mkIf config.services.postgresql.enable {
# immich uses this
enable = true;
location = "/var/backup/postgresql";
compression = "gzip"; # optional: "xz", "zstd", "none"
compression = "zstd"; # optional: "xz", "zstd", "none"
startAt = "03:58";
user = "postgres";
databases = ["immich"]; # set to all databases defined in esure databases
#databases = config.services.postgresql.ensureDatabases; # set to all databases defined in esure databases
};
services.mysql.ensureDatabases = ["FUCKING_NOTICE_ME"];
# install borg binary
environment.systemPackages = with pkgs; [borgbackup tree];