Fix backups of directories with spaces

This commit is contained in:
Jamie Cameron
2008-10-28 04:21:13 +00:00
parent ca9910657a
commit b9f52a370d
3 changed files with 7 additions and 2 deletions

View File

@@ -35,3 +35,5 @@ Files and directories to exclude can be specified for TAR format backups on Linu
---- Changes since 1.410 ----
Added checkboxes to control if failure of the pre and post-backup commands cause the whole job to be regarded as a failure.
Prevent non-level-0 backups and updating of the /etc/dumpdates file for backups of directories that are not filesystem mount points, as this isn't supported by the <tt>dump</tt> command.
---- Changes since 1.430 ----
Fixed a bug that prevented backups of directories with spaces in their names from working properly on Linux.

View File

@@ -338,7 +338,8 @@ local $tapecmd = $_[0]->{'multi'} && $_[0]->{'fs'} eq 'tar' ? $multi_cmd :
$_[0]->{'notape'} ? undef :
$_[0]->{'multi'} ? undef :
$_[3] && !$config{'nonewtape'} ? $newtape_cmd : $notape_cmd;
local @dirs = split(/\s+/, $_[0]->{'dir'});
local @dirs = $_[0]->{'tabs'} ? split(/\t+/, $_[0]->{'dir'})
: split(/\s+/, $_[0]->{'dir'});
if ($_[0]->{'fs'} eq 'tar') {
# tar format backup
$cmd = "tar ".($_[0]->{'update'} ? "-u" : "-c")." ".$flag;

View File

@@ -115,7 +115,9 @@ else {
$cmd .= "f '".&date_subs($_[0]->{'file'})."'";
}
$cmd .= " $_[0]->{'extra'}" if ($_[0]->{'extra'});
$cmd .= " ".join(" ", map { "'$_'" } split(/\s+/, $_[0]->{'dir'}));
local @dirs = $_[0]->{'tabs'} ? split(/\t+/, $_[0]->{'dir'})
: split(/\s+/, $_[0]->{'dir'});
$cmd .= " ".join(" ", map { "'$_'" } @dirs);
&system_logged("sync");
sleep(1);