r10315@llin: dpavlin | 2006-03-07 17:14:42 +0100
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 7 Mar 2006 16:14:49 +0000 (16:14 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 7 Mar 2006 16:14:49 +0000 (16:14 +0000)
 make first backup full if there is none

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

bin/BackupPC_recover_from_increments

index 9570709..2631e20 100755 (executable)
@@ -101,9 +101,15 @@ sub restore_increment {
 
        $bpc->ServerMesg("log User $user started recovery from increment $path");
 
-       my $full = 0;
+       my @backups = $bpc->BackupInfoRead( $host );
+
+       my $full = 1;
+       foreach my $b (@backups) {
+               $full = 0 if ($b->{type} eq 'full');
+       }
+
        my $r = $bpc->ServerMesg("backup $host $host $user $full");
-       print "backup --> $r";
+       print "backup ", $full ? 'full' : 'incremental', " --> $r";
        die $r if ($r =~ m/^error/);
 
        # Status_backup_in_progress