Feat: Add stoppost notify to backup sevices

This commit is contained in:
Bertrand Benjamin 2020-02-23 05:41:35 +01:00
parent 9e0db7bfb4
commit 01c68dd908
2 changed files with 4 additions and 0 deletions

View File

@ -8,3 +8,5 @@ IOSchedulingClass=2
IOSchedulingPriority=7 IOSchedulingPriority=7
ExecStartPre=/usr/bin/borg break-lock {{ borg_backup_repo }} ExecStartPre=/usr/bin/borg break-lock {{ borg_backup_repo }}
ExecStart={{ borg_script_path }}/{{ borg_script_filename }} 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'

View File

@ -1,4 +1,6 @@
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/etc/backups/run.sh 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'