X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=bin%2FBackupPC_recover_from_increments;h=d8e505aa2c7600f9b9060b8f029daeb4dd5b4c6a;hb=f3bda3d68e97002413a6626d57f50f8e07146d45;hp=c3e338d8e2f28b11a5f779b491e100e6207f0a5a;hpb=6f6315f294e468c52a68db53d8162690f74dc6cd;p=BackupPC.git diff --git a/bin/BackupPC_recover_from_increments b/bin/BackupPC_recover_from_increments index c3e338d..d8e505a 100755 --- a/bin/BackupPC_recover_from_increments +++ b/bin/BackupPC_recover_from_increments @@ -48,8 +48,8 @@ my $TopDir = $bpc->TopDir(); # check if host exists my $host_info = $bpc->HostInfoRead( $host ); -#print Dumper($host_info, $bpc->HostInfoRead( 'localhost' )); -die "host '$host' is not found\n" unless ($host_info->{$host}); +print Dumper($host_info, $bpc->HostInfoRead( 'localhost' )); +die "host '$host' is not found, please add it to config/hosts configuration file\n" unless ($host_info->{$host}); # create restore host configuration @@ -64,6 +64,7 @@ $Conf{TarIncrArgs} = ''; # fake ping when restoring $Conf{PingCmd} = '$pingPath -c 1 localhost', +$Conf{ClientNameAlias} = 'localhost'; $Conf{TarClientCmd} = 'zcat __restore_path__'; @@ -91,10 +92,12 @@ sub restore_increment { } link $path, $restore_path || die "can't create link $path -> $restore_path: $!\n"; - $bpc->ServerMesg("log User backuppc started restore of $path"); + my $user = $host_info->{$host}->{user} || die "can't get user for host $host"; + + $bpc->ServerMesg("log User $user started recovery from increment $path"); my $full = 0; - my $r = $bpc->ServerMesg("backup $host $host backuppc $full"); + my $r = $bpc->ServerMesg("backup $host $host $user $full"); print "backup --> $r"; die $r if ($r =~ m/^error/);