X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_archiveHost;h=2416df35271602daecd1c641643d6fd9d2351a8f;hp=723c8b3ab547846a8950acf348029cf1bbc1aae3;hb=5b79f9a3c01bca16dd4d211e76fc53daa549e421;hpb=82ffaa1c4130a34812fb241c2ea5cd3d0608bdab diff --git a/bin/BackupPC_archiveHost b/bin/BackupPC_archiveHost index 723c8b3..2416df3 100755 --- a/bin/BackupPC_archiveHost +++ b/bin/BackupPC_archiveHost @@ -38,7 +38,7 @@ # #======================================================================== # -# Version 3.1.0beta0, released 3 Sep 2007. +# Version 3.1.0, released 25 Nov 2007. # # See http://backuppc.sourceforge.net. # @@ -86,8 +86,9 @@ my $mesg = "Writing tar archive for host $host, backup #$bkupNum"; # # Build the command we will run # -$share = $bpc->shellEscape($share); -$host = $bpc->shellEscape($host); +$share = $bpc->shellEscape($share); +$host = $bpc->shellEscape($host); +my $outLocE = $bpc->shellEscape($outLoc); # # We prefer to use /bin/csh because the exit status of a pipeline @@ -106,14 +107,14 @@ if ( -x "/bin/csh" ) { } my $cmd = "$tarCreate -t -h $host -n $bkupNum -s $share . "; $cmd .= "| $compPath " if ( $compPath ne "cat" - && $compPath ne "/bin/cat + && $compPath ne "/bin/cat" && $compPath ne "" ); if ( -b $outLoc || -c $outLoc || -f $outLoc ) { # # Output file is a device or a regular file, so don't use split # - $cmd .= ">> $outLoc"; - $mesg .= " to $outLoc"; + $cmd .= ">> $outLocE"; + $mesg .= " to $outLocE"; } else { mkpath($outLoc) if ( !-d $outLoc ); if ( !-d $outLoc ) { @@ -121,11 +122,11 @@ if ( -b $outLoc || -c $outLoc || -f $outLoc ) { exit(1); } if ( $splitSize > 0 && -x $splitPath ) { - $cmd .= "| $splitPath -b $splitSize - $outLoc/$host.$bkupNum.tar$fileExt."; - $mesg .= ", split to output files $outLoc/$host.$bkupNum.tar$fileExt.*"; + $cmd .= "| $splitPath -b $splitSize - $outLocE/$host.$bkupNum.tar$fileExt."; + $mesg .= ", split to output files $outLocE/$host.$bkupNum.tar$fileExt.*"; } else { - $cmd .= "> $outLoc/$host.$bkupNum.tar$fileExt"; - $mesg .= " to output file $outLoc/$host.$bkupNum.tar$fileExt"; + $cmd .= "> $outLocE/$host.$bkupNum.tar$fileExt"; + $mesg .= " to output file $outLocE/$host.$bkupNum.tar$fileExt"; } } print("$mesg\n"); @@ -147,7 +148,7 @@ if ( $ret ) { if ( -d $outLoc && -x $parPath ) { 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*"; + my $parCmd = "$parPath c -r$parfile $outLocE/$host.$bkupNum.tar$fileExt.par2 $outLocE/$host.$bkupNum.tar$fileExt*"; $ret = system($parCmd); if ( $ret ) { print("Executing: $parCmd\n");