ensure postgres backups exist

This commit is contained in:
2025-10-18 18:18:03 -05:00
parent c8e7d0ac7f
commit 39336740e1
2 changed files with 4 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ in {
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
}; };
# postgresql backups currently immich is the only user # postgresql backups currently immich is the only user
services.postgresqlBackup = lib.mkIf config.services.postgresql.enable { services.postgresqlBackup = lib.mkIf (config.services.postgresql.ensureDatabases != []) {
enable = true; enable = true;
location = "/var/backup/postgresql"; location = "/var/backup/postgresql";
compression = "zstd"; # optional: "xz", "zstd", "none" compression = "zstd"; # optional: "xz", "zstd", "none"

View File

@@ -115,7 +115,9 @@ in {
]; ];
# add postgresql database that is automatically created to the backup list # add postgresql database that is automatically created to the backup list
services.postgresqlBackup.databases = ["immich"]; # set to all databases defined in esure databases #services.postgresqlBackup.databases = ["immich"]; # set to all databases defined in esure databases
services.postgresql.ensureDatabases = [service]; # set to all databases defined in esure databases
# add to backups # add to backups
homelab.backups.baks = { homelab.backups.baks = {