X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_restore;h=8f783168a5d6a841d0e242bba0dd2f0e3cc5d543;hp=5389e7d536f5ee749d2b61b54b4e932081f5e4bf;hb=5b3e6091d542c2e7445d5dd511cdf6e20aec8b8d;hpb=e951f787a66c5bd9e9955c3f657a5b44289c0fe1 diff --git a/bin/BackupPC_restore b/bin/BackupPC_restore index 5389e7d..8f78316 100755 --- a/bin/BackupPC_restore +++ b/bin/BackupPC_restore @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0, released 20 Jun 2004. +# Version 3.0.0alpha, released 23 Jan 2006. # # See http://backuppc.sourceforge.net. # @@ -43,6 +43,7 @@ use BackupPC::FileZIO; use BackupPC::Xfer::Smb; use BackupPC::Xfer::Tar; use BackupPC::Xfer::Rsync; +use BackupPC::Xfer::BackupPCd; use Socket; use File::Path; @@ -186,7 +187,10 @@ if ( (my $errMsg = CorrectHostCheck($hostIP, $host)) ) { # # Setup file extension for compression and open RestoreLOG output file # -$Conf{CompressLevel} = 0 if ( !BackupPC::FileZIO->compOk ); +if ( $Conf{CompressLevel} && !BackupPC::FileZIO->compOk ) { + $stat{hostError} = "Compress:Zlib not found"; + exit(RestoreCleanup($client)); +} my $fileExt = $Conf{CompressLevel} > 0 ? ".z" : ""; my $RestoreLOG = BackupPC::FileZIO->open("$Dir/RestoreLOG$fileExt", 1, $Conf{CompressLevel}); @@ -221,6 +225,16 @@ if ( $Conf{XferMethod} eq "tar" ) { $stat{hostError} = $errStr; exit(RestoreCleanup($client)); } +} elsif ( $Conf{XferMethod} eq "backuppcd" ) { + # + # Use backuppcd as the transport program. + # + if ( !defined($xfer = BackupPC::Xfer::BackupPCd->new($bpc)) ) { + my $errStr = BackupPC::Xfer::BackupPCd->errStr; + UserCommandRun("RestorePostUserCmd") if ( $NeedPostCmd ); + $stat{hostError} = $errStr; + exit(RestoreCleanup($client)); + } } else { # # Default is to use smbclient (smb) as the transport program.