/[BackupPC]/trunk/bin/BackupPC_recover_from_increments
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_recover_from_increments

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 347 by dpavlin, Tue Mar 7 14:03:12 2006 UTC revision 349 by dpavlin, Tue Mar 7 16:24:26 2006 UTC
# Line 27  use lib "/data/backuppc/lib"; Line 27  use lib "/data/backuppc/lib";
27  use BackupPC::Lib;  use BackupPC::Lib;
28    
29  my $host = 'restore';  my $host = 'restore';
30    my $share = '/etc';
31    
32  # connect to BackupPC_server  # connect to BackupPC_server
33    
# Line 58  my $restore_path = "$Conf{InstallDir}/$C Line 59  my $restore_path = "$Conf{InstallDir}/$C
59  my $conf_restore = <<'_END_OF_CONF_';  my $conf_restore = <<'_END_OF_CONF_';
60    
61  $Conf{XferMethod} = 'tar';  $Conf{XferMethod} = 'tar';
62    $Conf{TarShareName} = '__share__';
63    
64  $Conf{TarFullArgs} = 'echo "full backups are not supported in restore!" ; exit 1';  $Conf{TarFullArgs} = 'echo "full backups are not supported in restore!" ; exit 1';
65  $Conf{TarIncrArgs} = '';  $Conf{TarIncrArgs} = '';
# Line 73  $Conf{TarClientCmd} = 'zcat __restore_pa Line 75  $Conf{TarClientCmd} = 'zcat __restore_pa
75  _END_OF_CONF_  _END_OF_CONF_
76    
77  $conf_restore =~ s/__restore_path__/$restore_path/gs;  $conf_restore =~ s/__restore_path__/$restore_path/gs;
78    $conf_restore =~ s/__share__/$share/gs;
79    
80  my $config_file = "$bpc->{TopDir}/conf/${host}.pl";  my $config_file = "$bpc->{TopDir}/conf/${host}.pl";
81    
# Line 101  sub restore_increment { Line 104  sub restore_increment {
104    
105          $bpc->ServerMesg("log User $user started recovery from increment $path");          $bpc->ServerMesg("log User $user started recovery from increment $path");
106    
107          my $full = 0;          my @backups = $bpc->BackupInfoRead( $host );
108    
109            my $full = 1;
110            foreach my $b (@backups) {
111                    $full = 0 if ($b->{type} eq 'full');
112            }
113    
114          my $r = $bpc->ServerMesg("backup $host $host $user $full");          my $r = $bpc->ServerMesg("backup $host $host $user $full");
115          print "backup --> $r";          print "backup ", $full ? 'full' : 'incremental', " --> $r";
116          die $r if ($r =~ m/^error/);          die $r if ($r =~ m/^error/);
117    
118          # Status_backup_in_progress          # Status_backup_in_progress

Legend:
Removed from v.347  
changed lines
  Added in v.349

  ViewVC Help
Powered by ViewVC 1.1.26