BackupPC 3.2.1 - remove empty sharenames - patch

Rodrigo Severo <[email protected]>
Newsgroups gmane.comp.sysutils.backup.backuppc.devel
Message-ID <CAOdi6iY8jCLPw8QS_PikUehYy_8c_v16vi-f7UMD0dCJ9sSSjQ@mail.gmail.com>
Hi,


I'm starting to use BackupPC now and was being hit by the empty share name
issue described at
http://www.mail-archive.com/[email protected]/msg13242.html

In resume, if you leave an empty share name at the list of share names to
be backuped your backups will fail with the cryptic message "Backup
aborted()" and no further info.

The immediate solution is to manually delete any empty backup shares you
defined.

The attached patch fixes that making BackupPC ignore any empty share names
at backup time.

I believe this solution (ignoring the empty share) is better than any fix
at the interface level because this solution also solves problems created
by manually edited *config.pl* files.

Please consider this patch for inclusion.


Regards,

Rodrigo Severo

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev

_______________________________________________
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/
backuppc-3.2.1_remove-empty-shares.patch (application/octet-stream, 611 B)
--- /home/rodrigo/temp/Xfer.pm	2012-04-18 13:57:00.137258726 -0300
+++ /usr/lib/BackupPC/Xfer.pm	2012-04-18 14:42:45.128699685 -0300
@@ -110,6 +110,7 @@
 {
     my($conf) = @_;
     my $ShareNames;
+    my $index;
 
     if ( $conf->{XferMethod} eq "tar" ) {
         $ShareNames = $conf->{TarShareName};
@@ -131,6 +132,12 @@
     }
 
     $ShareNames = [$ShareNames] unless ref($ShareNames) eq "ARRAY";
+    #
+    # Removing empty shares.
+    #
+    foreach $index (keys @{$ShareNames}) {
+        delete($ShareNames->[$index]) if ( length($ShareNames->[$index]) eq 0 );
+    }
     return $ShareNames;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.