projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Added BackupPC::Xfer::Protocol as a common class for each Xfer
[BackupPC.git]
/
bin
/
BackupPC_archiveHost
diff --git
a/bin/BackupPC_archiveHost
b/bin/BackupPC_archiveHost
index
5740914
..
2416df3
100755
(executable)
--- a/
bin/BackupPC_archiveHost
+++ b/
bin/BackupPC_archiveHost
@@
-20,7
+20,7
@@
# Josh Marshall
#
# COPYRIGHT
# Josh Marshall
#
# COPYRIGHT
-# Copyright (C) 2001-200
4
Craig Barratt
+# Copyright (C) 2001-200
7
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
#
# 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
@@
-38,7
+38,7
@@
#
#========================================================================
#
#
#========================================================================
#
-# Version 3.
0.0beta2, released 11 Nov 2006
.
+# Version 3.
1.0, released 25 Nov 2007
.
#
# See http://backuppc.sourceforge.net.
#
#
# 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
#
#
# 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
#
# We prefer to use /bin/csh because the exit status of a pipeline
@@
-105,13
+106,15
@@
if ( -x "/bin/csh" ) {
exit(1);
}
my $cmd = "$tarCreate -t -h $host -n $bkupNum -s $share . ";
exit(1);
}
my $cmd = "$tarCreate -t -h $host -n $bkupNum -s $share . ";
-$cmd .= "| $compPath " if ( $compPath ne "cat" && $compPath ne "" );
+$cmd .= "| $compPath " if ( $compPath ne "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
#
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 .= ">> $outLoc
E
";
+ $mesg .= " to $outLoc
E
";
} else {
mkpath($outLoc) if ( !-d $outLoc );
if ( !-d $outLoc ) {
} else {
mkpath($outLoc) if ( !-d $outLoc );
if ( !-d $outLoc ) {
@@
-119,11
+122,11
@@
if ( -b $outLoc || -c $outLoc || -f $outLoc ) {
exit(1);
}
if ( $splitSize > 0 && -x $splitPath ) {
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 - $outLoc
E
/$host.$bkupNum.tar$fileExt.";
+ $mesg .= ", split to output files $outLoc
E
/$host.$bkupNum.tar$fileExt.*";
} else {
} else {
- $cmd .= "> $outLoc/$host.$bkupNum.tar$fileExt";
- $mesg .= " to output file $outLoc/$host.$bkupNum.tar$fileExt";
+ $cmd .= "> $outLoc
E
/$host.$bkupNum.tar$fileExt";
+ $mesg .= " to output file $outLoc
E
/$host.$bkupNum.tar$fileExt";
}
}
print("$mesg\n");
}
}
print("$mesg\n");
@@
-133,7
+136,7
@@
print("$mesg\n");
#
my $ret = system(@shell, $cmd);
if ( $ret ) {
#
my $ret = system(@shell, $cmd);
if ( $ret ) {
- print("Executing: @shell
-cf
$cmd\n");
+ print("Executing: @shell $cmd\n");
print("Error: $tarCreate, compress or split failed\n");
exit(1);
}
print("Error: $tarCreate, compress or split failed\n");
exit(1);
}
@@
-145,7
+148,7
@@
if ( $ret ) {
if ( -d $outLoc && -x $parPath ) {
if ( $parfile != 0 ) {
print("Running $parPath to create parity files\n");
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 $outLoc
E/$host.$bkupNum.tar$fileExt.par2 $outLocE
/$host.$bkupNum.tar$fileExt*";
$ret = system($parCmd);
if ( $ret ) {
print("Executing: $parCmd\n");
$ret = system($parCmd);
if ( $ret ) {
print("Executing: $parCmd\n");