X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_restore;h=5843a01880543fb7b21bf58cff0eda733b452869;hp=6583b00878ed9c1369e77a763675b19b3fb344af;hb=07d524e222fd3eeffccd2355f4a20ca5eba82f1b;hpb=8d7768574bb328c669a44c6efbff01e8a7e93d7e diff --git a/bin/BackupPC_restore b/bin/BackupPC_restore index 6583b00..5843a01 100755 --- a/bin/BackupPC_restore +++ b/bin/BackupPC_restore @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_restore: Restore files to a client. @@ -11,7 +11,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001 Craig Barratt +# Copyright (C) 2001-2003 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0, released 14 Jun 2003. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -264,6 +264,7 @@ my $xferArgs = { pipeWH => *WH, XferLOG => $RestoreLOG, XferMethod => $Conf{XferMethod}, + logLevel => $Conf{XferLogLevel}, bkupSrcHost => $RestoreReq{hostSrc}, bkupSrcShare => $RestoreReq{shareSrc}, bkupSrcNum => $RestoreReq{num}, @@ -332,6 +333,7 @@ if ( $useTar ) { open(STDERR, ">&STDOUT"); close(STDOUT); open(STDOUT, ">&WH"); + alarm(0); exec("$BinDir/BackupPC_tarCreate", @tarArgs); print(LOG $bpc->timeStamp, "can't exec $BinDir/BackupPC_tarCreate\n"); # FIX: need to cleanup xfer @@ -492,17 +494,17 @@ sub RestoreCleanup # kill off the tranfer program, first nicely then forcefully # if ( @xferPid ) { - kill(2, @xferPid); + kill($bpc->sigName2num("INT"), @xferPid); sleep(1); - kill(9, @xferPid); + kill($bpc->sigName2num("KILL"), @xferPid); } # # kill off the tar process, first nicely then forcefully # if ( $tarPid > 0 ) { - kill(2, $tarPid); + kill($bpc->sigName2num("INT"), $tarPid); sleep(1); - kill(9, $tarPid); + kill($bpc->sigName2num("KILL"), $tarPid); } } @@ -626,6 +628,7 @@ sub UserCommandRun XferLOG => $RestoreLOG, stat => \%stat, xferOK => $stat{xferOK} || 0, + hostError => $stat{hostError}, type => $type, bkupSrcHost => $RestoreReq{hostSrc}, bkupSrcShare => $RestoreReq{shareSrc},