Lines 1301-1308
Link Here
|
1301 |
$cmd .= "$::unz"; |
1301 |
$cmd .= "$::unz"; |
1302 |
} |
1302 |
} |
1303 |
$cmd .= "("; |
1303 |
$cmd .= "("; |
1304 |
$cmd .= "mkdir -p $::device ; "; |
1304 |
$cmd .= "mkdir -p \"$::device\" ; "; |
1305 |
$cmd .= "cd $::device ; "; |
1305 |
$cmd .= "cd \"$::device\" ; "; |
1306 |
$cmd .= "$::path{cpio} -i "; |
1306 |
$cmd .= "$::path{cpio} -i "; |
1307 |
$cmd .= "-m "; |
1307 |
$cmd .= "-m "; |
1308 |
$cmd .= "-d "; |
1308 |
$cmd .= "-d "; |
Lines 1351-1359
Link Here
|
1351 |
|
1351 |
|
1352 |
# Have to take leading './' off to make rsync's include/exclude work right |
1352 |
# Have to take leading './' off to make rsync's include/exclude work right |
1353 |
$cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | "; |
1353 |
$cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | "; |
1354 |
|
|
|
1355 |
$cmd .= "$::path{rsync} "; |
1354 |
$cmd .= "$::path{rsync} "; |
1356 |
$cmd .= "--include-from=- --exclude=* "; |
1355 |
$cmd .= "--files-from=- "; |
1357 |
$cmd .= "--archive "; |
1356 |
$cmd .= "--archive "; |
1358 |
$cmd .= "$::rsync_verb_flag "; |
1357 |
$cmd .= "$::rsync_verb_flag "; |
1359 |
$cmd .= "--delete --delete-excluded "; |
1358 |
$cmd .= "--delete --delete-excluded "; |
Lines 1368-1374
Link Here
|
1368 |
$cmd .= "$remote:"; |
1367 |
$cmd .= "$remote:"; |
1369 |
} |
1368 |
} |
1370 |
} |
1369 |
} |
1371 |
$cmd .= "$dir/ $::device"; |
1370 |
$cmd .= "\"$dir/\" \"$::device\""; |
1372 |
|
1371 |
|
1373 |
push(@cmds, $cmd); |
1372 |
push(@cmds, $cmd); |
1374 |
|
1373 |
|
Lines 1658-1664
Link Here
|
1658 |
my $tmpfile = "$cfg::tmpdir/ar.$PROCESS_ID"; |
1657 |
my $tmpfile = "$cfg::tmpdir/ar.$PROCESS_ID"; |
1659 |
my $remove = ''; |
1658 |
my $remove = ''; |
1660 |
|
1659 |
|
1661 |
&log("| NOTE: ar archives will not descend directories"); |
1660 |
&log("| NOTE: ar archives will not recurse into subdirectories,"); |
|
|
1661 |
&log("| which makes them inappropriate for most backups."); |
1662 |
&log("| Be sure this is what you want."); |
1662 |
|
1663 |
|
1663 |
if (defined($remote) and ($level != 0)) { |
1664 |
if (defined($remote) and ($level != 0)) { |
1664 |
my $time = &get_last_date($label, $level, 'numeric'); |
1665 |
my $time = &get_last_date($label, $level, 'numeric'); |
Lines 1682-1692
Link Here
|
1682 |
$cmd = "cd \"$dir\" && "; |
1683 |
$cmd = "cd \"$dir\" && "; |
1683 |
$cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote, '-maxdepth 1 ! -type d'); |
1684 |
$cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote, '-maxdepth 1 ! -type d'); |
1684 |
$cmd .= "> $filelist; "; |
1685 |
$cmd .= "> $filelist; "; |
|
|
1686 |
# Escape any spaces in filenames. |
1687 |
$cmd .= "$::path{sed} -i -e 's/ /\\\\ /g' $filelist; "; |
1685 |
|
1688 |
|
1686 |
$cmd .= "$::path{ar} rc"; |
1689 |
$cmd .= "$::path{ar} rc"; |
1687 |
$cmd .= "$::ar_verb_flag "; |
1690 |
$cmd .= "$::ar_verb_flag "; |
1688 |
$cmd .= "$tmpfile "; |
1691 |
$cmd .= "$tmpfile "; |
1689 |
$cmd .= "`$::path{cat} $filelist`"; |
1692 |
$cmd .= "\@$filelist "; |
1690 |
$cmd .= "; $::path{cat} $tmpfile $::z"; |
1693 |
$cmd .= "; $::path{cat} $tmpfile $::z"; |
1691 |
|
1694 |
|
1692 |
# Buffer both sides if remote |
1695 |
# Buffer both sides if remote |
Lines 1800-1811
Link Here
|
1800 |
|
1803 |
|
1801 |
$cmd = "cd \"$dir\" && "; |
1804 |
$cmd = "cd \"$dir\" && "; |
1802 |
$cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote); |
1805 |
$cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote); |
1803 |
$cmd .= "> $filelist; "; |
1806 |
$cmd .= " | $::path{lha} a"; |
1804 |
|
|
|
1805 |
$cmd .= "$::path{lha} a"; |
1806 |
$cmd .= "$::lha_verb_flag "; |
1807 |
$cmd .= "$::lha_verb_flag "; |
1807 |
$cmd .= "$tmpfile "; |
1808 |
$cmd .= "$tmpfile "; |
1808 |
$cmd .= "`$::path{cat} $filelist`"; |
|
|
1809 |
$cmd .= "; $::path{cat} $tmpfile $::z"; |
1809 |
$cmd .= "; $::path{cat} $tmpfile $::z"; |
1810 |
|
1810 |
|
1811 |
# Buffer both sides if remote |
1811 |
# Buffer both sides if remote |
Lines 2766-2771
Link Here
|
2766 |
$::path{'dd'} = &checkinpath('dd'); |
2766 |
$::path{'dd'} = &checkinpath('dd'); |
2767 |
$::path{'printf'} = &checkinpath('printf'); |
2767 |
$::path{'printf'} = &checkinpath('printf'); |
2768 |
$::path{'mkdir'} = &checkinpath('mkdir'); |
2768 |
$::path{'mkdir'} = &checkinpath('mkdir'); |
|
|
2769 |
$::path{'sed'} = &checkinpath('sed'); |
2769 |
|
2770 |
|
2770 |
push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'})); |
2771 |
push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'})); |
2771 |
|
2772 |
|
Lines 4894-4902
Link Here
|
4894 |
$rex .= '\)"'; |
4895 |
$rex .= '\)"'; |
4895 |
} |
4896 |
} |
4896 |
# Show what the darn thing is constructing for prune expressions. |
4897 |
# Show what the darn thing is constructing for prune expressions. |
4897 |
&log("| \"find\" regex for pruning is:"); |
4898 |
my $temp = $rex; |
4898 |
&log("| $rex"); |
4899 |
$temp =~ s/\\([()|])/$1/g; |
4899 |
&line(); |
4900 |
&log("| \"find\" regex for pruning (shell escaping omitted for clarity) is:"); |
|
|
4901 |
&log("| $temp"); |
4900 |
$cmd .= '-regex ' . $rex . ' -prune -o '; |
4902 |
$cmd .= '-regex ' . $rex . ' -prune -o '; |
4901 |
} else { |
4903 |
} else { |
4902 |
# Show what the darn thing is constructing for prune expressions. |
4904 |
# Show what the darn thing is constructing for prune expressions. |
Lines 4906-4911
Link Here
|
4906 |
# don't have permissions on and are running as non-root) |
4908 |
# don't have permissions on and are running as non-root) |
4907 |
$cmd .= "-depth "; |
4909 |
$cmd .= "-depth "; |
4908 |
} |
4910 |
} |
|
|
4911 |
&line(); |
4909 |
|
4912 |
|
4910 |
$cmd .= "$::mountpoint_flag "; |
4913 |
$cmd .= "$::mountpoint_flag "; |
4911 |
$cmd .= "! -type s "; |
4914 |
$cmd .= "! -type s "; |
Lines 5301-5312
Link Here
|
5301 |
print $::msg "| Checking '$cfg::buffer' on this machine... "; |
5304 |
print $::msg "| Checking '$cfg::buffer' on this machine... "; |
5302 |
$pipecmd = "sh $tmp_script "; |
5305 |
$pipecmd = "sh $tmp_script "; |
5303 |
} else { |
5306 |
} else { |
|
|
5307 |
$pipecmd = |
5308 |
"$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; " . |
5309 |
"cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; " . |
5310 |
"sh $tmp_script; rm -rf $cfg::tmpdir')"; |
5304 |
print $::msg "| Checking '$cfg::buffer' on host $host... "; |
5311 |
print $::msg "| Checking '$cfg::buffer' on host $host... "; |
5305 |
$pipecmd = "$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; sh $tmp_script; rm -rf $cfg::tmpdir')"; |
|
|
5306 |
} |
5312 |
} |
5307 |
|
5313 |
|
5308 |
if (!defined($::debug)) { |
5314 |
if (!defined($::debug)) { |
5309 |
|
|
|
5310 |
open(PIPE,"$pipecmd |") || die; |
5315 |
open(PIPE,"$pipecmd |") || die; |
5311 |
|
5316 |
|
5312 |
$explicit_success = 0; |
5317 |
$explicit_success = 0; |