fix email notification, again, again
This commit is contained in:
parent
ff765d3d2e
commit
4031ada385
1 changed files with 21 additions and 12 deletions
33
backup.nix
33
backup.nix
|
@ -98,21 +98,30 @@ in {
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
requires = [ "postgresql.service" ];
|
requires = [ "postgresql.service" ];
|
||||||
|
|
||||||
unitConfig.OnFailure = let
|
unitConfig.OnFailure = "misskey-backup-failure.service";
|
||||||
script = pkgs.writeScript "misskey-backup-failure" ''
|
};
|
||||||
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
|
systemd.services.misskey-backup-failure = {
|
||||||
A backup process has failed. Logs to follow:
|
description = "Misskey backup failure notification";
|
||||||
|
|
||||||
$logs
|
serviceConfig.User = user;
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
|
||||||
EOMSG
|
script = ''
|
||||||
)
|
invocationId="$(systemctl show --value -p InvocationID misskey-backup.service)"
|
||||||
"
|
logs="$(journalctl _SYSTEMD_INVOCATION_ID= -u misskey-backup.service)"
|
||||||
'';
|
|
||||||
in "${script}";
|
${notifyError} "backup" "Misskey Backup Failure Notification" "$(<<EOMSG
|
||||||
|
A backup process has failed. Logs to follow:
|
||||||
|
|
||||||
|
$logs
|
||||||
|
|
||||||
|
EOMSG
|
||||||
|
)
|
||||||
|
"
|
||||||
|
'';
|
||||||
|
|
||||||
|
requires = [ "postfix.service" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
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