]> git.proxmox.com Git - pmg-api.git/commit
backup: fix #3146 add email notifications
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 1 Mar 2021 14:12:19 +0000 (15:12 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 5 Mar 2021 21:41:38 +0000 (22:41 +0100)
commitf8c773d8e101a02509c3a76fbdc9709ce0de90ed
tree15ac4e8998a40b1b1939f44b8cd6653377827d15
parenta528c44128c72e79613d750c6b4b9559ab10af28
backup: fix #3146 add email notifications

this patch addresses the missing email notification for scheduled
backup related tasks, which we have in all our other products, for our
mail product.

the parameter names are inspired by PBS' datastore config.

the default is 'never' in order to stay consistent with the current
code.

it uses the templateing system for the notification, because this
results in less code and a bit of added flexibility for the users.

the recipient address is currently hardcoded to the admin address in
pmg.conf as we also send the (admin) pmgreport there, and I did not
want to overengineer this (even more).

I shortly considered adding a $SIG{'__DIE__'} handler to the
run_backup API call but dropped the idea due to the warning in
perlvar(1).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Makefile
src/PMG/API2/PBS/Job.pm
src/PMG/Backup.pm
src/PMG/PBSConfig.pm
src/templates/backup-notification.tt [new file with mode: 0644]