43 |
|
|
44 |
my $TopDir = $bpc->TopDir(); |
my $TopDir = $bpc->TopDir(); |
45 |
|
|
46 |
print Dumper(\%Conf); |
#print Dumper(\%Conf); |
47 |
|
|
48 |
# check if host exists |
# check if host exists |
49 |
|
|
50 |
die "host $host is not found" unless ($bpc->HostInfoRead( $host )); |
my $host_info = $bpc->HostInfoRead( $host ); |
51 |
|
print Dumper($host_info, $bpc->HostInfoRead( 'localhost' )); |
52 |
|
die "host '$host' is not found, please add it to config/hosts configuration file\n" unless ($host_info->{$host}); |
53 |
|
|
54 |
# create restore host configuration |
# create restore host configuration |
55 |
|
|
64 |
|
|
65 |
# fake ping when restoring |
# fake ping when restoring |
66 |
$Conf{PingCmd} = '$pingPath -c 1 localhost', |
$Conf{PingCmd} = '$pingPath -c 1 localhost', |
67 |
|
$Conf{ClientNameAlias} = 'localhost'; |
68 |
|
|
69 |
$Conf{TarClientCmd} = 'zcat __restore_path__'; |
$Conf{TarClientCmd} = 'zcat __restore_path__'; |
70 |
|
|
92 |
} |
} |
93 |
link $path, $restore_path || die "can't create link $path -> $restore_path: $!\n"; |
link $path, $restore_path || die "can't create link $path -> $restore_path: $!\n"; |
94 |
|
|
95 |
$bpc->ServerMesg("log User backuppc started restore of $path"); |
my $user = $host_info->{$host}->{user} || die "can't get user for host $host"; |
96 |
|
|
97 |
|
$bpc->ServerMesg("log User $user started recovery from increment $path"); |
98 |
|
|
99 |
my $full = 0; |
my $full = 0; |
100 |
my $r = $bpc->ServerMesg("backup $host $host backuppc $full"); |
my $r = $bpc->ServerMesg("backup $host $host $user $full"); |
101 |
print "backup --> $r"; |
print "backup --> $r"; |
102 |
die $r if ($r =~ m/^error/); |
die $r if ($r =~ m/^error/); |
103 |
|
|