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 # add to backups
system.backups.baks = { 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: lib.mapAttrsToList (srv_name: cfg:
{ {
name = srv_name; # attribute key 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 ) servers
); );

View File

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