postgres: create daily backups

This commit is contained in:
Antoine Martin 2021-01-30 19:32:46 +01:00
parent 91eaa2f008
commit 8b037b16a4
2 changed files with 8 additions and 0 deletions

View file

@ -76,6 +76,7 @@
repo = (lib.removeSuffix "\n" (builtins.readFile ./borg-backup-repo));
paths = [
"/var/lib/matrix-synapse"
"/var/backup/postgresql"
];
exclude = [];
};

View file

@ -28,6 +28,13 @@ in {
package = pkgs.postgresql_12;
};
services.postgresqlBackup = {
enable = true;
databases = [ "matrix-synapse" ];
# Borg backup starts at midnight so create DB dump just before
startAt = "*-*-* 23:30:00";
};
services.matrix-synapse = {
enable = true;
server_name = domain;