Le 10/01/2014 16:07, backu...@kosowsky.org a écrit :
> 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...
>
>


I agree, I wouldn't want notification for evry non fatal errors as most 
of the time, it's just some files being deleted or renamed during a 
backup (and they'll be catched on the next backup).

I wrote a script which parse those Xfer errors, so I can be alerted if 
the number of non fatal error is above a threshold. I use it with 
Zabbix, and it's really helpful (those interested can take a look at 
this: 
http://gitweb.firewall-services.com/?p=zabbix-agent-addons;a=blob_plain;f=zabbix_scripts/check_backuppc_sudo;hb=HEAD)

Regards, Daniel

-- 
Daniel Berteaud
FIREWALL-SERVICES SARL.
Société de Services en Logiciels Libres
Technopôle Montesquieu
33650 MARTILLAC
Tel : 05 56 64 15 32
Fax : 05 56 64 15 32
Web : http://www.firewall-services.com


------------------------------------------------------------------------------
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
BackupPC-devel@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-devel
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to