backup: start pg dump before restic backup
This commit is contained in:
parent
76ab7d3f0e
commit
5fd87acd57
|
@ -9,7 +9,7 @@
|
|||
compression = "zstd";
|
||||
compressionLevel = 9;
|
||||
pgdumpOptions = "--create --clean";
|
||||
startAt = "*-*-* 06:00:00";
|
||||
startAt = "*-*-* 04:00:00";
|
||||
};
|
||||
|
||||
restic.backups =
|
||||
|
@ -24,6 +24,10 @@
|
|||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 04:30:00";
|
||||
RandomizedDelaySec = "5m";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
|
@ -35,6 +39,7 @@
|
|||
});
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
"restic/offsite/private" = {
|
||||
mode = "400";
|
||||
|
@ -63,5 +68,9 @@
|
|||
ln -fs {,/home}/root/.ssh/id_offsite-backup.pub
|
||||
ln -fs {,/home}/root/.ssh/config
|
||||
'';
|
||||
|
||||
systemd.timers = lib.mkIf config.services.postgresqlBackup.enable {
|
||||
postgresqlBackup.timerConfig.RandomizedDelaySec = "5m";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue