r10312@llin: dpavlin | 2006-03-07 15:03:04 +0100
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 7 Mar 2006 14:03:12 +0000 (14:03 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 7 Mar 2006 14:03:12 +0000 (14:03 +0000)
 fixed skipping of everything with isn't .tar.gz increment

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@347 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_recover_from_increments

index 8c01fbc..9570709 100755 (executable)
@@ -85,6 +85,11 @@ warn "written config:\n$conf_restore\n";
 sub restore_increment {
        my $path = shift || die "need path!";
 
+       if ($path !~ m/\.tar\.gz$/i) {
+               print "skipping $path, not .tar.gz increment\n";
+               return;
+       }
+
        print "working on $path\n";
 
        if (-e $restore_path) {
@@ -137,10 +142,10 @@ foreach my $restore_inc (@ARGV) {
                        restore_increment( $File::Find::name );
                }, follow => 0 }, $restore_inc);
 
-       } elsif (-f $restore_inc && $restore_inc =~ m/\.tar\.gz$/i) {
+       } elsif (-f $restore_inc) {
                restore_increment( $restore_inc );
        } else {
-               warn "skipped: $restore_inc, not directory or .tar.gz increment\n";
+               warn "skipped: $restore_inc, not file or directory\n";
        }
 
 }