[wellylug] Shell script problem

John Fouhy john at fouhy.net
Thu Nov 1 12:55:41 NZDT 2007


On 01/11/2007, michael at diaspora.gen.nz <michael at diaspora.gen.nz> wrote:
> > SOURCE=/cygdrive/d
> > DEST=10.1.1.77::backup/Shaft/
> > EXCLUDES='--exclude="saswork/" --exclude="pagefile.sys" --exclude="*.tmp"'
>
> Try eliminating the single quotes here.  I suspect what is happening is
> that $EXCLUDES is being passed as a single argument to rsync, and rsync's
> argument parser is getting confused.

Ahh.  That is an interesting thought.

If I just drop the single quotes, I get:

   ./backup.sh: line 5: --exclude=pagefile.sys: command not found

If I drop the single quotes and escape all the spaces (replace ' '
with '\ ' in the EXCLUDES lines), then it works.

So I guess that is solved.  I'm glad there was a logical explanation
for what seemed to me very illogical behaviour.  Thanks for your help,
Atom and Michael.

-- 
John.




More information about the wellylug mailing list