X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=bin%2FBackupPC_archive;h=e1e99005bb8b8d02c9aa6ff9710369bf30b22a62;hb=dcb39df8e33e09eabfb4eae471c2e6447094d0e2;hp=73425d55fee33ade0075f84f931417af48672f57;hpb=17dcbbebb871212f90b81bb97f8d1feb528bdc43;p=BackupPC.git diff --git a/bin/BackupPC_archive b/bin/BackupPC_archive index 73425d5..e1e9900 100644 --- a/bin/BackupPC_archive +++ b/bin/BackupPC_archive @@ -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. # @@ -157,6 +157,10 @@ local(*RH, *WH); # Run an optional pre-archive command # UserCommandRun("ArchivePreUserCmd"); +if ( $? && $Conf{UserCmdCheckStatus} ) { + $stat{hostError} = "ArchivePreUserCmd returned error status $?"; + exit(ArchiveCleanup($client)); +} $NeedPostCmd = 1; $xfer = BackupPC::Xfer::Archive->new($bpc); @@ -271,7 +275,13 @@ sub ArchiveCleanup # # Run an optional post-archive command # - UserCommandRun("ArchivePostUserCmd") if ( $NeedPostCmd ); + if ( $NeedPostCmd ) { + UserCommandRun("ArchivePostUserCmd"); + if ( $? && $Conf{UserCmdCheckStatus} ) { + $stat{hostError} = "RestorePreUserCmd returned error status $?"; + $stat{xferOK} = 0; + } + } rename("$Dir/ArchiveLOG$fileExt", "$Dir/ArchiveLOG.$lastNum$fileExt"); rename("$Dir/$reqFileName", "$Dir/ArchiveInfo.$lastNum");