Merge "borg-backup: send explicit email on backup failure"
This commit is contained in:
commit
9db55a55f3
@ -53,6 +53,12 @@
|
|||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
with_inventory_hostnames: borg-backup-server
|
with_inventory_hostnames: borg-backup-server
|
||||||
|
|
||||||
|
- name: Set cron flag to enable error reports
|
||||||
|
cron:
|
||||||
|
name: BORG_UNDER_CRON
|
||||||
|
env: yes
|
||||||
|
job: '1'
|
||||||
|
|
||||||
- name: Install backup cron job
|
- name: Install backup cron job
|
||||||
cron:
|
cron:
|
||||||
name: "Run borg backup to {{ item }}"
|
name: "Run borg backup to {{ item }}"
|
||||||
|
@ -60,7 +60,12 @@ if [ ${backup_exit} -eq 0 ]; then
|
|||||||
info "Backup finished successfully"
|
info "Backup finished successfully"
|
||||||
else
|
else
|
||||||
info "Backup finished with errors"
|
info "Backup finished with errors"
|
||||||
|
if [ ${BORG_UNDER_CRON:-0} -eq 1 ]; then
|
||||||
|
echo "Backups failed on host $(hostname) at $(date)." | \
|
||||||
|
mail -s "ACTION REQUIRED: Backup failed on $(hostname)" infra-root@openstack.org
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
exit ${backup_exit}
|
exit ${backup_exit}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user