fix email notification, again
This commit is contained in:
parent
2b4b5b9176
commit
ff765d3d2e
1 changed files with 12 additions and 10 deletions
22
backup.nix
22
backup.nix
|
@ -98,19 +98,21 @@ in {
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
requires = [ "postgresql.service" ];
|
requires = [ "postgresql.service" ];
|
||||||
|
|
||||||
unitConfig.OnFailure = ''
|
unitConfig.OnFailure = let
|
||||||
invocationId="$(systemctl show --value -p InvocationID misskey-backup.service)"
|
script = pkgs.writeScript "misskey-backup-failure" ''
|
||||||
logs="$(journalctl _SYSTEMD_INVOCATION_ID= -u misskey-backup.service)"
|
invocationId="$(systemctl show --value -p InvocationID misskey-backup.service)"
|
||||||
|
logs="$(journalctl _SYSTEMD_INVOCATION_ID= -u misskey-backup.service)"
|
||||||
|
|
||||||
${notifyError} "backup" "Misskey Backup Failure Notification" "$(<<EOMSG
|
${notifyError} "backup" "Misskey Backup Failure Notification" "$(<<EOMSG
|
||||||
A backup process has failed. Logs to follow:
|
A backup process has failed. Logs to follow:
|
||||||
|
|
||||||
$logs
|
$logs
|
||||||
|
|
||||||
EOMSG
|
EOMSG
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
'';
|
'';
|
||||||
|
in "${script}";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.misskey-backup = { timerConfig.Persistent = true; };
|
systemd.timers.misskey-backup = { timerConfig.Persistent = true; };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue