How to rsync PULL multiple files/dirs

Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco) jonachen at cisco.com
Sat Jan 28 02:10:10 GMT 2006


Thanks!  Now I have a different problem but related to rsync pull.
Currently I can't figure out what is wrong with my bash script or don't
see the error.  Hopefully the information below is enough.

When I echo the command it looks like below...

/usr/bin/rsync -e ssh --archive --sparse --compress --update --dry-run
--exclude=cdersync.tar.gz --exclude=*.bz2  --exclude=*.jpg
--exclude=*.mp3 --exclude=ZDE --exclude=*.rpm --exclude=*.sit
jona at cdeprd:' /users/jona/cde /users/jona/Desktop  /users/jona/.bashrc
/users/jona/.profile' /users/jona/ 

Just pasting via terminal it works great.

But executing with "bash -x" the below lines...

#grouping together
RSYNC_CMD="${RSYNC_CMD} ${RSYNC_ARGS} $RSYNC_DEST_HOST${RSYNC_FILES}"

#excuting
${RSYNC_CMD}

#bash debug result
+ /usr/bin/rsync -e ssh --archive --sparse --compress --update --dry-run
--exclude=cdersync.tar.gz '--exclude=*.bz2' '--exclude=*.jpg'
'--exclude=*.mp3' --exclude=ZDE '--exclude=*.rpm' '--exclude=*.sit'
'jona at cdeprd:'\''' /users/jona/cde /users/jona/Desktop
/users/jona/.bashrc '/users/jona/.profile'\''' /users/jona/

Would return "rsync error: syntax or usage error (code 1) at
main.c(836)"

Any idea what I did wrong?

> -----Original Message-----
> From: Wayne Davison [mailto:wayned at samba.org] 
> Sent: Thursday, January 26, 2006 5:11 PM
> To: Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco)
> Cc: rsync at lists.samba.org
> Subject: Re: How to rsync PULL multiple files/dirs
> 
> On Thu, Jan 26, 2006 at 04:59:04PM -0800, Jonathan Chen -X 
> (jonachen - The Armada Group,  Inc. at Cisco) wrote:
> > I would like the below statement be turned into a PULL from remote 
> > host [...]  /users/jona/cde /users/jona/Desktop /users/jona/.bashrc 
> > /users/jona/.profile cdeprd:/users/jona/
> 
> The "ADVANCED USAGE" section of the rsync manpage explains 
> how to specify multiple source items from a remote rsync.  
> For instance:
> 
> rsync [OPTIONS] jona at cdeprd:'cde Desktop .bashrc .profile' /users/jona
> 
> ..wayne..
> 


More information about the rsync mailing list