From 01c68dd90807701706abb5247c6dfc9795a8adf0 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sun, 23 Feb 2020 05:41:35 +0100 Subject: [PATCH] Feat: Add stoppost notify to backup sevices --- files/choux_borg.service | 2 ++ files/dd_borg/automatic-backup.service | 2 ++ 2 files changed, 4 insertions(+) diff --git a/files/choux_borg.service b/files/choux_borg.service index af854ec..533b5d8 100644 --- a/files/choux_borg.service +++ b/files/choux_borg.service @@ -8,3 +8,5 @@ IOSchedulingClass=2 IOSchedulingPriority=7 ExecStartPre=/usr/bin/borg break-lock {{ borg_backup_repo }} ExecStart={{ borg_script_path }}/{{ borg_script_filename }} +ExecStopPost=-bash -c '[[ $EXIT_STATUS == 0 ]] && notify-send "Backup finished"' +ExecStopPost=-bash -c '[[ $EXIT_STATUS != 0 ]] && notify-send "Backup failed." -u critical' diff --git a/files/dd_borg/automatic-backup.service b/files/dd_borg/automatic-backup.service index c0209d2..4a58e59 100644 --- a/files/dd_borg/automatic-backup.service +++ b/files/dd_borg/automatic-backup.service @@ -1,4 +1,6 @@ [Service] Type=oneshot ExecStart=/etc/backups/run.sh +ExecStopPost=-bash -c '[[ $EXIT_STATUS == 0 ]] && notify-send "Backup finished: Drive can be removed."' +ExecStopPost=-bash -c '[[ $EXIT_STATUS != 0 ]] && notify-send "Backup failed." -u critical'