From b9f52a370d09daa34511ddbfca0d8292ef4bdefc Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 28 Oct 2008 04:21:13 +0000 Subject: [PATCH] Fix backups of directories with spaces --- fsdump/CHANGELOG | 2 ++ fsdump/linux-lib.pl | 3 ++- fsdump/solaris-lib.pl | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fsdump/CHANGELOG b/fsdump/CHANGELOG index 2a70bfb97..dcb160743 100644 --- a/fsdump/CHANGELOG +++ b/fsdump/CHANGELOG @@ -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 dump command. +---- Changes since 1.430 ---- +Fixed a bug that prevented backups of directories with spaces in their names from working properly on Linux. diff --git a/fsdump/linux-lib.pl b/fsdump/linux-lib.pl index e6ebd0776..ad46cea28 100644 --- a/fsdump/linux-lib.pl +++ b/fsdump/linux-lib.pl @@ -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; diff --git a/fsdump/solaris-lib.pl b/fsdump/solaris-lib.pl index 70e6da380..c91273ff9 100644 --- a/fsdump/solaris-lib.pl +++ b/fsdump/solaris-lib.pl @@ -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);