Re: Feature request(v3, v4). Add non fatal errors notifications to BackupPC_sendEmail.
<[email protected]> Fri, 10 Jan 2014 10:07:56 -0500
| Newsgroups | gmane.comp.sysutils.backup.backuppc.devel |
|---|---|
| Message-ID | <[email protected]> |
Alexander Moisseev wrote at about 11:29:41 +0400 on Friday, January 10, 2014:
> In some cases nonfatal error may occurs during backup (e.g. xfer errors due to source host filesystem changes). Incomplete or inconsistent backup (even more regular inconsistent backups) requires user attention.
>
> Craig, would you add to BackupPC_sendEmail notification to users if host has recently backed up but nonfatal errors occured during last backup?
>
> Code below is not real patch against BackupPC_sendEmail. Just for illustrate the conception.
>
> if ( time - $last > $Conf{EMailNotifyOldBackupDays} * 24*3600 ) {
> my $subj = defined($Conf{EMailNoBackupRecentSubj})
> ? $Conf{EMailNoBackupRecentSubj}
> : $Lang->{EMailNoBackupRecentSubj};
> my $mesg = defined($Conf{EMailNoBackupRecentMesg})
> ? $Conf{EMailNoBackupRecentMesg}
> : $Lang->{EMailNoBackupRecentMesg};
> my $firstTime = sprintf("%.1f",
> (time - $Backups[0]{startTime}) / (24*3600));
> my $days = sprintf("%.1f", (time - $last) / (24 * 3600));
> sendUserEmail($user, $host, $mesg, $subj, {
> firstTime => $firstTime,
> days => $days,
> userName => user2name($user),
> numBackups => $numBackups,
> }) if ( !defined($Jobs{$host}) );
> next;
> }
> + # [-1] in the lines below implies most recent backup for each host.
> + if ( $Backups[-1]{xferErrs}
> + || $Backups[-1]{xferBadShare}
> + || $Backups[-1]{xferBadFile}
> + || $Backups[-1]{tarErrs}
> + ) {
> + #
> + # Here call sendUserEmail() to
> + # send notification to user about errors in last backup
> + #
> + }
> if ( $numBadOutlook > 0
> && time - $lastGoodOutlook > $Conf{EMailNotifyOldOutlookDays}
> * 24 * 3600 ) {
>
> --
> Alexander
>
I'm not sure I would favor such an addition.
I already get enough emails from BackupPC for various "fatal" errors
given the nature of laptops not being connected to the network
regularly.
Also, many of my backups have regular "non-fatal" errors due to xfer
errors when the source host filesystem changes (e.g., a file gets
deleted during the backup time) or due to various Windows files that
may be locked and blocked.
IMO, the email notification should only be for severe (i.e. 'fatal')
errors where backups are not happening or completing which otherwise
you might never be aware of.
If one wants to look for fine-grained errors within a backup then one
can go to the web interface and/or examine the log files
directly. Alternatively, one could write a tool to parse the xfer log
files to sort and classify the various error types. Perhaps add it to
something like logwatch if you wish.
My point is that this is a very different exercise than simply
notifying that host X hasn't been backed up in Y days...
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
BackupPC-devel mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-devel
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/