Feat: Add StartPre backup notify

This commit is contained in:
Bertrand Benjamin 2020-02-23 05:43:28 +01:00
parent 01c68dd908
commit dc0b6e139b
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Type=simple
Nice=19 Nice=19
IOSchedulingClass=2 IOSchedulingClass=2
IOSchedulingPriority=7 IOSchedulingPriority=7
ExecStartPre=notify-send "Backup starts"
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 finished"'

View File

@ -1,5 +1,6 @@
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=notify-send "Backup starts"
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 finished: Drive can be removed."'
ExecStopPost=-bash -c '[[ $EXIT_STATUS != 0 ]] && notify-send "Backup failed." -u critical' ExecStopPost=-bash -c '[[ $EXIT_STATUS != 0 ]] && notify-send "Backup failed." -u critical'