X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_archiveHost;h=4bad6c68d9a932bbdb2eaf20cbcaf7578853a5d4;hp=34a6e485ef5365ef57ac1650472f42e2377a8249;hb=e951f787a66c5bd9e9955c3f657a5b44289c0fe1;hpb=ce708288691ba7dd95a8dac7a468bc0e4c1d6588 diff --git a/bin/BackupPC_archiveHost b/bin/BackupPC_archiveHost index 34a6e48..4bad6c6 100755 --- a/bin/BackupPC_archiveHost +++ b/bin/BackupPC_archiveHost @@ -17,9 +17,10 @@ # # AUTHOR # Craig Barratt +# Josh Marshall # # COPYRIGHT -# Copyright (C) 2001-2003 Craig Barratt +# Copyright (C) 2001-2004 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 @@ -37,7 +38,7 @@ # #======================================================================== # -# Version 2.1.0beta0, released 20 Mar 2004. +# Version 2.1.0, released 20 Jun 2004. # # See http://backuppc.sourceforge.net. # @@ -101,7 +102,7 @@ if ( -b $outLoc || -c $outLoc || -f $outLoc ) { print("Error: unable to create output directory $outLoc\n"); exit(1); } - if ( $splitSize && -x $splitPath ) { + if ( $splitSize > 0 && -x $splitPath ) { $cmd .= "| $splitPath -b $splitSize - $outLoc/$host.$bkupNum.tar$fileExt."; $mesg .= ", split to output files $outLoc/$host.$bkupNum.tar$fileExt.*"; } else { @@ -116,6 +117,7 @@ print("$mesg\n"); # my $ret = system($cmd); if ( $ret ) { + print("Executing: $cmd\n"); print("Error: $tarCreate, compress or split failed\n"); exit(1); } @@ -125,10 +127,14 @@ if ( $ret ) { # ie: not a tape device). # if ( -d $outLoc && -x $parPath ) { - print("Running $parPath to create parity files\n"); - $ret = system("$parPath a -n $parfile $outLoc/$host.$bkupNum.tar$fileExt.par $outLoc/$host.$bkupNum.tar$fileExt.*"); - if ( $ret ) { - print("Error: $parPath failed\n"); - exit(1); + if ( $parfile != 0 ) { + print("Running $parPath to create parity files\n"); + my $parCmd = "$parPath c -r$parfile $outLoc/$host.$bkupNum.tar$fileExt.par2 $outLoc/$host.$bkupNum.tar$fileExt.*"; + $ret = system($parCmd); + if ( $ret ) { + print("Executing: $parCmd\n"); + print("Error: $parPath failed\n"); + exit(1); + } } }