Filenames with blanks
ivan at wssource.com
Sat Aug 24 05:06:01 EST 2002
I did not see Tim's note and what you tell about it sounds like
I am scanning src_host for files changed during last $days to update my
targ_dir on targ_host. Yes, if I do whole directory from the source
host, it works fine with "foo bar" files. The reason I do not want this is
because I need a subset of files only. Imagine big archive from which I
need to update just last couple of days.
You are right about -r option: it does nothing when I operate on the list
Quotes: I do put them around COM ( tried even "\"$COM\""). It looks to me
like if I put quotes inside COM, then rsynk looks for filenames
that include quotes as part of the name. If the qoutes are outside, then
none of the files with blanks in the name could be found because they
are treated as 2 files.
So, what is the correct syntax for quoting?
On Fri, 23 Aug 2002, jw schultz wrote:
> On Fri, Aug 23, 2002 at 06:09:21PM -0400, Ivan Kovalev wrote:
> > Command like this:
> > rsync -rxlupogtSvve ssh
> > $src_host:"/home/wss_disk/calendar.data/'Conference Calls'" $targ_dir
> > works fine with blanks embeded in the file name.
> > When I try to script it like this:
> > COM='`find '$src_dir' -mtime -'$days' -type f `'
> > rsync -rxlupogtSvve ssh $src_host:"$COM" $targ_dir
> > works fine on regular filenames, but does not see the ones with blanks
> > in the middle.
> > I changed my COM to pipe through little script to produce the same
> > output where either the whole filepath or just the file name will be
> > quoted (as in the first example). That breakes it complitely and this
> > version does not work even for single word files. Output looks like
> > this:
> > .......................
> > receiving file list ...
> > link_stat /home/wss_disk/calendar.data/'Conference : No such file or
> > directory
> > link_stat Calls' : No such file or directory
> > link_stat /home/wss_disk/calendar.data/'Economic' : No such file or
> > directory
> > I probably am missing something simple, but could not figure what is it.
> > Please advise. Thank you.
> As Tim pointed out scanning $dest_host for files that
> were recently modified to overwrite them if they were
> changed on the $src_host makes very little sense.
> rsync handles file names with spaces just fine if you let
> it. Why do you think you need to create this file list in
> the first place when you are using the -r option?
> Based on your design decisions i doubt that you quite
> understood understood what Tim meant by a list so i'll
> illustrate. Your find operation means that $COM is set to
> something like
> /home/wss_disk/calendar.data/Conference foo
> /home/wss_disk/calendar.data/Economic bar
> The result being this command line
> rsync -rxlupogtSvve ssh $src_host:"/home/wss_disk/calendar.data/Conference foo /home/wss_disk/calendar.data/Economic bar" $targ_dir
> Putting quote marks inside $COM won't protect the spaces.
> The quotes have to be outside of $COM.
> If you can explain why you need the find instead of doing
> rsync -rxlupogtSvv -e ssh $src_host:$src_dir/ $targ_dir
> I'll be glad to show you how.
> J.W. Schultz Pegasystems Technologies
> email address: jw at pegasys.ws
> Remember Cernan and Schmitt
More information about the rsync