* Added BackupPC::Xfer::Protocol as a common class for each Xfer
[BackupPC.git] / lib / BackupPC / Xfer / BackupPCd.pm
index e4e4b3c..e6dd5b0 100644 (file)
@@ -11,7 +11,7 @@
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
-#   Copyright (C) 2006  Craig Barratt
+#   Copyright (C) 2006-2007  Craig Barratt
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
 #
 #========================================================================
 #
-# Version 3.0.0alpha, released 23 Jan 2006.
+# Version 3.1.0, released 25 Nov 2007.
 #
 # See http://backuppc.sourceforge.net.
 #
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -38,6 +38,7 @@
 package BackupPC::Xfer::BackupPCd;
 
 use strict;
 package BackupPC::Xfer::BackupPCd;
 
 use strict;
+use base qw(BackupPC::Xfer::Protocol);
 
 sub new
 {
 
 sub new
 {
@@ -71,20 +72,6 @@ sub new
     return $t;
 }
 
     return $t;
 }
 
-sub args
-{
-    my($t, $args) = @_;
-
-    foreach my $arg ( keys(%$args) ) {
-       $t->{$arg} = $args->{$arg};
-    }
-}
-
-sub useTar
-{
-    return 0;
-}
-
 sub start
 {
     my($t) = @_;
 sub start
 {
     my($t) = @_;
@@ -117,8 +104,9 @@ sub start
             #
             # TODO: fix this message - just refer to the backup, not time?
             #
             #
             # TODO: fix this message - just refer to the backup, not time?
             #
-            $incrDate = $bpc->timeStamp($t->{lastFull} - 3600, 1);
-            $logMsg = "incr backup started back to $incrDate for directory"
+            $incrDate = $bpc->timeStamp($t->{incrBaseTime} - 3600, 1);
+            $logMsg = "incr backup started back to $incrDate"
+                    . " (backup #$t->{incrBaseBkupNum}) for directory"
                     . " $t->{shareName}";
             $incrFlag = 1;
         }
                     . " $t->{shareName}";
             $incrFlag = 1;
         }
@@ -220,47 +208,4 @@ sub run
     }
 }
 
     }
 }
 
-sub abort
-{
-    my($t, $reason) = @_;
-
-    # TODO
-    return 1;
-}
-
-sub errStr
-{
-    my($t) = @_;
-
-    return $t->{_errStr};
-}
-
-sub xferPid
-{
-    my($t) = @_;
-
-    return ();
-}
-
-#
-# Returns a hash ref giving various status information about
-# the transfer.
-#
-sub getStats
-{
-    my($t) = @_;
-
-    return { map { $_ => $t->{$_} }
-            qw(byteCnt fileCnt xferErrCnt xferBadShareCnt xferBadFileCnt
-               xferOK hostAbort hostError lastOutputLine)
-    };
-}
-
-sub getBadFiles
-{
-    my($t) = @_;
-
-    return @{$t->{badFiles}};
-}
-
 1;
 1;