* Added multi-level incrementals. Still needs testing.
[BackupPC.git] / lib / BackupPC / Xfer / Smb.pm
index 6886397..3839271 100644 (file)
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 2.1.0beta1, released 9 Apr 2004.
+# Version 3.0.0alpha, released 23 Jan 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -103,24 +103,11 @@ sub start
     } else {
        #
        # Turn $conf->{BackupFilesOnly} and $conf->{BackupFilesExclude}
-       # into a hash of arrays of files
+       # into a hash of arrays of files, and $conf->{SmbShareName}
+       # to an array
        #
-       $conf->{SmbShareName} = [ $conf->{SmbShareName} ]
-                       unless ref($conf->{SmbShareName}) eq "ARRAY";
-       foreach my $param qw(BackupFilesOnly BackupFilesExclude) {
-           next if ( !defined($conf->{$param}) );
-           if ( ref($conf->{$param}) eq "ARRAY" ) {
-               $conf->{$param} = {
-                       $conf->{SmbShareName}[0] => $conf->{$param}
-               };
-           } elsif ( ref($conf->{$param}) eq "HASH" ) {
-               # do nothing
-           } else {
-               $conf->{$param} = {
-                       $conf->{SmbShareName}[0] => [ $conf->{$param} ]
-               };
-           }
-       }
+       $bpc->backupFileConfFix($conf, "SmbShareName");
+
        $t->{fileIncludeHash} = {};
         if ( defined($conf->{BackupFilesOnly}{$t->{shareName}}) ) {
             foreach my $file ( @{$conf->{BackupFilesOnly}{$t->{shareName}}} ) {
@@ -143,11 +130,13 @@ sub start
         } else {
             $timeStampFile = "$t->{outDir}/timeStamp.level0";
             open(LEV0, ">", $timeStampFile) && close(LEV0);
-            utime($t->{lastFull} - 3600, $t->{lastFull} - 3600, $timeStampFile);
+            utime($t->{incrBaseTime} - 3600, $t->{incrBaseTime} - 3600,
+                  $timeStampFile);
            $smbClientCmd = $conf->{SmbClientIncrCmd};
             $logMsg = "incr backup started back to "
-                        . $bpc->timeStamp($t->{lastFull} - 3600, 0)
-                        . "for share $t->{shareName}";
+                    . $bpc->timeStamp($t->{incrBaseTime} - 3600, 0)
+                    . " (backup #$t->{incrBaseBkupNum}) for share"
+                    . " $t->{shareName}";
         }
     }
     my $args = {
@@ -274,6 +263,7 @@ sub readOutput
                     || /^\s*Call timed out: server did not respond/i
                    || /^\s*tree connect failed: ERRDOS - ERRnoaccess \(Access denied\.\)/
                    || /^\s*tree connect failed: NT_STATUS_BAD_NETWORK_NAME/
+                   || /^\s*NT_STATUS_INSUFF_SERVER_RESOURCES listing /
                  ) {
            if ( $t->{hostError} eq "" ) {
                $t->{XferLOG}->write(\"This backup will fail because: $_\n");