Customise the email sent after VirtualMin backup?

4 posts / 0 new
Last post
#1 Fri, 10/24/2014 - 09:55
bill.damage

Customise the email sent after VirtualMin backup?

We have 2 Webmin managed servers hosted on the net and 2 physical servers in our offices which they back up to. On Fridays, one of the Webmin servers backs itself to each of the office servers, and on Mondays the other does the same. The problem is the email from these doesn't distinguish which one was done, i.e. we get the same emnail content for both. The subject is "Completed backup of Virtualmin on foo.com". That's actually correct, since the same Webmin server was backed up - but twice, one to each office. All we'd need is to change this to say ""Completed backup of Virtualmin on foo.com to bar.com". It could take the target from the target ftp site, or a user entered label. Any quick fix please?

Sun, 10/26/2014 - 21:20
Joe
Joe's picture

That's not currently possible...it'd be pretty easy to add, though, I think.

Something like this, in backup.pl, might do the trick:

--- backup.pl 2014-09-04 18:25:01.769035852 -0500
+++ backup.pl.new 2014-10-26 21:17:10.378212287 -0500
@@ -200,16 +200,16 @@
if ($ok && !@$errdoms) {
$output_header .= &text('backup_done',
&nice_size($size))." ";
- $subject = &text('backup_donesubject', $host);
+ $subject = &text('backup_donesubject', $host, $dest);
}
elsif ($ok && @$errdoms) {
$output_header .= &text('backup_partial',
&nice_size($size))." ";
- $subject = &text('backup_partialsubject', $host);
+ $subject = &text('backup_partialsubject', $host, $dest);
}
else {
$output_header .= $text{'backup_failed'}." ";
- $subject = &text('backup_failedsubject', $host);
+ $subject = &text('backup_failedsubject', $host, $dest);
}
$total_time = time() - $start_time;
$output_header .= &text('backup_time',

And, then modify lang/en:

--- lang/en 2014-09-12 22:50:56.926494587 -0500
+++ lang/en.new 2014-10-26 21:18:41.827113613 -0500
@@ -2255,9 +2255,9 @@
backup_partial2=Virtual servers that failed :
backup_time=Total backup time was $1.
backup_failed=Backup failed! See the progress output above for the reason why.
-backup_donesubject=Completed backup of Virtualmin on $1
-backup_partialsubject=Partially completed backup of Virtualmin on $1
-backup_failedsubject=Failed backup of Virtualmin on $1
+backup_donesubject=Completed backup of Virtualmin on $1 to $2
+backup_partialsubject=Partially completed backup of Virtualmin on $1 to $2
+backup_failedsubject=Failed backup of Virtualmin on $1 to $2
backup_upload=Uploading archive to FTP server $1 ..
backup_upload2=Uploading archive to SSH server $1 ..
backup_upload3=Uploading archive to Amazon's S3 service ..

I haven't tested this, but it looks simple enough that I probably didn't screw it up. I'll ask Jamie to consider changing this behavior in the next version of Virtualmin. I can't think of any good reason for this not to be the default.

--

Check out the forum guidelines!

Sun, 10/26/2014 - 21:28
Joe
Joe's picture

Actually, I'll probably just check in this change for the next Virtualmin release, unless Jamie has objections or has a different preference for how to implement it. Probably no need for Jamie to spend much time thinking about something so simple.

--

Check out the forum guidelines!

Mon, 10/27/2014 - 01:18
Joe
Joe's picture

The ticket I opened about that change is here ( http://virtualmin.com/node/35003 ). And I'm about to test it and check in the changes, with one modification suggested by Jamie. So, next revision of Virtualmin will behave the way you've suggested.

Thanks for pointing this issue out.

--

Check out the forum guidelines!

Topic locked