Fix backups of directories with spaces
authorJamie Cameron <jcameron@webmin.com>
Tue, 28 Oct 2008 04:21:13 +0000 (04:21 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 28 Oct 2008 04:21:13 +0000 (04:21 +0000)
fsdump/CHANGELOG
fsdump/linux-lib.pl
fsdump/solaris-lib.pl

index 2a70bfb..dcb1607 100644 (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.
index e6ebd07..ad46cea 100644 (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;
index 70e6da3..c91273f 100644 (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);