Hi,

Les Stott wrote on 14.11.2007 at 00:22:35 [Re: [BackupPC-users] Is there a 
command line reporting tool for backuppc?]:
> 
> I was wondering if you could help out with two additional changes........
> 
> I want to run this script as a DumpPostUserCmd such that i can email a 
> small report with some detail about what the backup did.
> 
> The output of the script is great, but it runs for all hosts, I'd like 
> it to only run for the host that is being backed up. How can i make it 
> use say $1 as an argument for the host (i.e. using $client from the 
> DumpPostUserCmd)??

sorry for keeping you waiting so long for such a simple matter. I was
planning to do it "properly", but my time is currently in short supply, so
here's a quick hack for the time being:

change line 40:

-foreach my $host (@hosts) {
+foreach my $host (@ARGV ? @ARGV : @hosts) {

Now any parameters to the script will be interpreted as host names to report
on. Without parameters you get a full list.

> Second.....
> 
> if it shows xfer errors how easy would it be to append the xferlog to 
> the email?

Well, you *could* add something like

    my $topdir = $bpc -> TopDir ();
    open XFERLOG, "/path/to/BackupPC_zcat 
$topdir/pc/$host/XferLOG.$backup->{num}.z |"
      or die "Can't BackupPC_zcat XferLOG: $!\n";
    while (<XFERLOG>) {
      print
        if /DENIED/ and not /System Volume Information|RECYCLER|Watson/;
    }
    close XFERLOG; # or error handling, really

after line 67 (the "*WARNING* Backup with ERRORs!" line), but you probably
want a proper MIME attachment (even more so if you call it for more than one
host at a time!), meaning you want to integrate sending the e-Mail into the
script, requiring option handling and so on. I'll get back to it, but not in
the next few weeks.

Regards,
Holger

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to