postgres: create daily backups
This commit is contained in:
parent
91eaa2f008
commit
8b037b16a4
|
@ -76,6 +76,7 @@
|
||||||
repo = (lib.removeSuffix "\n" (builtins.readFile ./borg-backup-repo));
|
repo = (lib.removeSuffix "\n" (builtins.readFile ./borg-backup-repo));
|
||||||
paths = [
|
paths = [
|
||||||
"/var/lib/matrix-synapse"
|
"/var/lib/matrix-synapse"
|
||||||
|
"/var/backup/postgresql"
|
||||||
];
|
];
|
||||||
exclude = [];
|
exclude = [];
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,13 @@ in {
|
||||||
package = pkgs.postgresql_12;
|
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 = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
server_name = domain;
|
server_name = domain;
|
||||||
|
|
Loading…
Reference in a new issue