Hi
Still working on a Proxmox setup, hope to convince our customers to switch.
I have edited my vzdump-hook-script to send an email when backup is OK and when it failed.
I can get the VM ID in the script, but cannot see how to get any Job information like Job ID, Job name, etc
I would like to use the $phase job-start, job-end, job-abort.
Trying not to have to bombard customers with an email for every VM when all their VM's are in one job.
My edit
Still working on a Proxmox setup, hope to convince our customers to switch.
I have edited my vzdump-hook-script to send an email when backup is OK and when it failed.
I can get the VM ID in the script, but cannot see how to get any Job information like Job ID, Job name, etc
I would like to use the $phase job-start, job-end, job-abort.
Trying not to have to bombard customers with an email for every VM when all their VM's are in one job.
My edit
Code:
# send email to customer
if ($phase eq 'backup-end') {
$to = '*****';
$from = '*****';
$subject = "VM${vmid} Backup Success";
$message = 'Success';
open(MAIL, "|/usr/sbin/sendmail -t");
# Email Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
# Email Body
print MAIL $message;
close(MAIL);
#print "Email Sent Successfully\n";
}
# send email to customer
if ($phase eq 'backup-abort') {
$to = '****';
$from = '****';
$subject = "VM${vmid} Backup Failed";
$message = 'Failed';
open(MAIL, "|/usr/sbin/sendmail -t");
# Email Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
# Email Body
print MAIL $message;
close(MAIL);
#print "Email Sent Successfully\n";
}