Koozali.org: home of the SME Server
Obsolete Releases => SME Server 8.x => Topic started by: compsos on November 06, 2011, 02:14:27 AM
-
Hi
Trying to add another email address for the report to be sent to.
Has anyone tried adding an additional email address for the backup report from the do_backwk script?
Would the do_backwk file be the best point to modify or the crontab initialising the script?
-
The backup from: and to: addresses appear to be hard-coded into /etc/e-smith/events/actions/workstation-backup-dar (from: admin-backup; to: admin).
To send these notifications elsewhere, modify the 'admin' account in server-manager and setup an email forwarding address.
I don't know if the 'forwarding address' field will take multiple email addresses - if it does, add as many as you want. If it doesn't, create a group for admin notifications, add to that group all of the people you want to receive admin notifications, and modify the admin user to forward email to the new group.
If the above options don't meet your needs, I'd recommend:
- copy workstation-backup-dar to workstation-backup-dar.org
- modify /etc/e-smith/events/actions/workstation-backup-dar to use db variables for From & To
- create a 'new feature request' for this in the bug tracker, and upload the results of 'diff -u workstation-backup-dar workstation-backup-dar.org'
[warning: untested guess follows]
The modifications you'd need might look something like this:
Insert between lines 78 & 79:
78 my $mntdir = $backupwk->prop('Mount') || '/mnt/smb';
my $frommail = $backupwk->prop('FromMail') || 'admin-backup';
my $tomail = $backupwk->prop('ToMail') || 'admin';
79 my $tmpdir;
Then modify lines originally numbered 81 & 82 to look like this:
Old 81:
$report .= "From: admin-backup\n";
Change to:
$report .= "From: ".$frommail."\n";
Old 82:
$report .= "To: admin\n";
Change to:
$report .= "To: ".$tomail."\n";
Now set your workstation backup from: and to: addresses as follows:
config setprop backupwk FromMail backup@abccorp.org
config setprop backupwk ToMail support@abcconsulting.com
-
Thanks mmccarn
The 2nd suggestion is along the lines we are looking for. Need just to send this report.
Will try and report back.
-
compsos
Alternatively you can install the mailsorting contrib and create a rule for the admin user that sends a copy of the backup report to another email address.
This I believe is currently the most effective way to distribute any selected admin emails to other users.
-
[warning: untested guess follows]
The modifications you'd need might look something like this:
Insert between lines 78 & 79:
78 my $mntdir = $backupwk->prop('Mount') || '/mnt/smb';
my $frommail = $backupwk->prop('FromMail') || 'admin-backup';
my $tomail = $backupwk->prop('ToMail') || 'admin';
79 my $tmpdir;
Then modify lines originally numbered 81 & 82 to look like this:
Old 81:
$report .= "From: admin-backup\n";
Change to:
$report .= "From: ".$frommail."\n";
Old 82:
$report .= "To: admin\n";
Change to:
$report .= "To: ".$tomail."\n";
That will only work temporarily. As soon as an update of e-smith0backup will be released and installed this will be overwritten. I think it is a bad suggestion, core code should not be modified. I suggest you launch a NFR to have this added, or better indeed use mailsorting in the admin e-mailbox to direct the message to another e-mailaddress.
-
That will only work temporarily. As soon as an update of e-smith0backup will be released and installed this will be overwritten. I think it is a bad suggestion, core code should not be modified. I suggest you launch a NFR to have this added, or better indeed use mailsorting in the admin e-mailbox to direct the message to another e-mailaddress.
there's a workaround:
- copy /etc/e-smith/events/actions/workstation-backup-dar to /etc/e-smith/events/actions/workstation-backup-mydar
- edit /etc/e-smith/events/actions/workstation-backup-mydar as for mmccarn suggestion
- change the backup program with
config setprop backupwk Program mydar
this will survive to system update but system migration/restore
I agree that a NFR is the best option
-
Hi All
Thank you for the suggestions. mmccarn your mods are working perfectly. I will raise a NFR based on that code. Thank you.
Stefano, understand and good suggestion.