From df73c9177ab397741a8a402be16132463d136013 Mon Sep 17 00:00:00 2001 From: Lionel Coupouchetty-Ramouchetty Date: Tue, 25 Feb 2020 13:35:23 +0100 Subject: [PATCH] feat: Email log after service execution --- README.md | 2 ++ conf/systemd.service | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 99584ea..77edace 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ Sat *-*-1..7 18:00:00 : The first saturday of every month at 18:00 5,17:00 : Every day at 5 AM and at 5 PM +After each invocation an e-mail will be sent to root@yourdomain.tld with the execution log. + See here for more info : https://wiki.archlinux.org/index.php/Systemd/Timers#Realtime_timer At the end of the installation, the app displays the public_key and the user to give to the person who has access to the server B. diff --git a/conf/systemd.service b/conf/systemd.service index 93684b0..040e061 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -5,6 +5,7 @@ After=network.target [Service] Type=oneshot ExecStart=/usr/local/bin/backup-with-__APP__-answerbot +ExecStartPost=/bin/bash -c 'echo -e "Subject: YunoHost Restic backup log\n$(/bin/journalctl _SYSTEMD_INVOCATION_ID=`systemctl show -p InvocationID --value __APP__.service`)" | /usr/sbin/sendmail root' User=root Group=root