Change Backup Subject "vzdump backup status"

Feb 2, 2024
16
0
1
Hello,

I want to change the email backup subject from vzdump backup status (node1): backup successful
I went to file /usr/share/perl5/PVE/VZDump.pm and changed the line:

FROM:
my $subject_template = "vzdump backup status ({{hostname}}): {{status-text}}";

TO:
my $subject_template = "Backup Status: {{status-text}}";

But it is not working.
Do I need to restart some service?

Thanks
Best Regards

Marco
 
Hello,

I want to change the email backup subject from vzdump backup status (node1): backup successful
I went to file /usr/share/perl5/PVE/VZDump.pm and changed the line:

FROM:
my $subject_template = "vzdump backup status ({{hostname}}): {{status-text}}";

TO:
my $subject_template = "Backup Status: {{status-text}}";

But it is not working.
Do I need to restart some service?

Thanks
Best Regards

Marco
After a reboot it is working.
But the question is now. How to apply changes to this file, without a reboot?
Which service need to be restarted?
 
Hello,

it's the pvedaemon which need to be restarted.

I know that it's not good to edit a file.
But I do not edit it manually. I wrote a script, that checks every night, if the line

my $subject_template =

must be changed again.

It's the only way if you want to modify the backup email.
 
It's the only way if you want to modify the backup email.
My question would be, why do you want to do that? Any mail program or script can handle RegEx or Contains/Does not contain.
 
My question would be, why do you want to do that? Any mail program or script can handle RegEx or Contains/Does not contain.
Because its counterintuitive to do so.
Its 2024, and having hard-coded mail templates with us needing to do some script magics, just to change the subject, based on a Regex... is pretty backwards. That regex could change in future, and we will have to modify those scripts again.

And you cant specify for which mail to use that script, it runs against ALL outgoing mails, so you may end up modifying the subject of something else.

There is also the current state of the subject, being totally useless for anything other than "OK/NOT OK" state.
You get some info like "vzdump backup status {{node}} : backup successful".
It could be "PVE {{guestname}} on {{node}}: Backup OK".
Shorter and more informative.

Having being forced to use a single hard coded template leaves bad taste.
 
Because its counterintuitive to do so.
Its 2024, and having hard-coded mail templates with us needing to do some script magics, just to change the subject, based on a Regex... is pretty backwards. That regex could change in future, and we will have to modify those scripts again.

And you cant specify for which mail to use that script, it runs against ALL outgoing mails, so you may end up modifying the subject of something else.

There is also the current state of the subject, being totally useless for anything other than "OK/NOT OK" state.
You get some info like "vzdump backup status {{node}} : backup successful".
It could be "PVE {{guestname}} on {{node}}: Backup OK".
Shorter and more informative.

Having being forced to use a single hard coded template leaves bad taste.

Feel free to show your support in our Bugtracker in this issue:
https://bugzilla.proxmox.com/show_bug.cgi?id=4526

Customizable templates are on the roadmap, but there is no ETA yet.
 
  • Like
Reactions: Falk R. and ku4eto
Hello,

it's the pvedaemon which need to be restarted.

I know that it's not good to edit a file.
But I do not edit it manually. I wrote a script, that checks every night, if the line

my $subject_template =

must be changed again.

It's the only way if you want to modify the backup email.
Are you sure is pvedaemon that need to be restarted ?

Is not working in my case ...
 
In PVE 8.2.4, the new file that need to be edited in order to change the email subject is
Yes, but keep in mind that this file might be overwritten after a package update. We plan to add a more permanent mechanism soonish, extracting the templates to files was a preparatory step for that.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!