BackupPC-users

Re: [BackupPC-users] email for completed backup

2009-06-24 14:50:24
Subject: Re: [BackupPC-users] email for completed backup
From: Bernd Rilling <brilling AT ifsw.uni-stuttgart DOT de>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 24 Jun 2009 20:29:26 +0200
Am Mittwoch, 24. Juni 2009 schrieb Nick Smith:
> I would like to know if backuppc has the ability to not only send an
> email if a backup hasn't complete in a set amount of time, but also
> when a backup is completed?
> If not, is it possible to submit a feature request?
>
> I would really like to be able to email clients that there computers
> were successfully backed up each night.
>
> I have yet to find a good way to go about doing this, ive tried the
> pre/post command, but it seems that they run even when a backup has
> failed.

I'll do that the other way. My Users are informed if there are errors in the 
last backup.

My script is started  every day (23:55, all backups are hopefully done) per 
cron ...
--> search4backup-errors /var/lib/backuppc/pc/[hostname]

It checks the file "backups" in that dir and pulls out the column 10 
(xfererrors). 
If that number > 0 (some errors occured) then the date is checked.
If the date of the last backup is today then the e-mail is created and sent 
out to the users e-mail-address (pulled out from /etc/backuppc/hosts)
 
The script is not perfect, it's a quick&dirty hack and the best: it works for 
me :-)
Maybe there is somebody out who will beautify and correct/improve or makes it 
more common....

For your requirement:
You have to change the line 65 from 
"if($s_fields[10] > 0)"  to "if($s_fields[10] == 0)"
and change also the text for the e-mail ....


Bye, Bernd
-- 
Institut für Strahlwerkzeuge
Universität Stuttgart
Pfaffenwaldring 43
70569 Stuttgart

Attachment: search4backup-errors
Description: Perl program

------------------------------------------------------------------------------
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/