ensure postgres backups exist
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user