fix postgres backup

This commit is contained in:
nyanloutre 2022-11-29 21:45:48 +01:00
parent 8f36dda4e8
commit 3b4f25ead8
1 changed files with 10 additions and 3 deletions

View File

@ -119,8 +119,7 @@ in
"/var/lib/gitea"
"/var/lib/grafana"
"/var/lib/jackett"
"/var/lib/matrix-synapse"
"/var/lib/postgresql/.zfs/snapshot/borgsnap"
"/mnt/borgsnap/postgresql"
"/var/lib/radarr"
"/var/lib/sonarr"
"/var/lib/transmission"
@ -130,6 +129,7 @@ in
"/mnt/paul-home/paul"
"/var/sieve"
"/var/vmail"
"/mnt/backup_loutre/amandoleen"
];
exclude = [
"/var/lib/radarr/.config/Radarr/radarr.db-wal"
@ -147,9 +147,14 @@ in
weekly = 4;
monthly = 12;
};
preHook = "${pkgs.zfs}/bin/zfs snapshot loutrepool/var/postgresql@borgsnap";
preHook = ''
${pkgs.zfs}/bin/zfs snapshot loutrepool/var/postgresql@borgsnap
mkdir -p /mnt/borgsnap/postgresql
${config.security.wrapperDir}/mount -t zfs loutrepool/var/postgresql@borgsnap /mnt/borgsnap/postgresql
'';
readWritePaths = [ "/var/lib/postfix/queue/maildrop" ];
postHook = ''
${config.security.wrapperDir}/umount /mnt/borgsnap/postgresql
${pkgs.zfs}/bin/zfs destroy loutrepool/var/postgresql@borgsnap
'';
};
@ -537,6 +542,8 @@ in
};
};
systemd.services."borgbackup-job-loutre".serviceConfig.TemporaryFileSystem = ["/mnt/borgsnap"];
dogetipbot-telegram.enable = true;
ipmihddtemp.enable = true;