Re: rsync and trailing '/'

2007-03-05 Thread Y Sidhu

From: Noah <[EMAIL PROTECTED]>
Subject: rsync and trailing '/'
To: User Questions 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

rsync  version 2.6.9  protocol version 29

I am running rsync, and I wonder if having the trailing '/' at the end
of the directory is proper configuration?

--- snip ---

/usr/local/bin/rsync -avz -e ssh [EMAIL PROTECTED]:/var/cron/ /var/cron/

--- snip ---

Cheers,

Noah


Whoa, Noah duuude! That trailing slash makes mondo difference. Use with
caution FBSD dudes!
--
Yudhvir Singh Sidhu
Mars or Bust
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: rsync and trailing '/'

2007-03-05 Thread Matthew Seaman
Noah wrote:
> rsync  version 2.6.9  protocol version 29
> 
> I am running rsync, and I wonder if having the trailing '/' at the end
> of the directory is proper configuration?
> 
> --- snip ---
> 
> /usr/local/bin/rsync -avz -e ssh [EMAIL PROTECTED]:/var/cron/ /var/cron/
> 

Presence of absence of the final '/' on the rsync *source* directory
means different things.

If you say:

   rsync -a foo/ bar/

directory bar will end up with a copy of the contents of foo. So a 
file foo/wibble.txt will end up as bar/wibble.txt. If
on the other hand you say:

   rsync -a foo bar/

then you end up with a directory structure 'bar/foo/...', and wibble.txt
ends up as bar/foo/wibble.txt

Other than that, the presence or absence of the trailing slash on the
*target* directory doesn't make a great deal of difference.  I usually
try and work things so that the rsync command line always has trailing
slashes on both the source and the destination directories simply for
consistencies' sake.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   Flat 3
  7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
  Kent, CT11 9PW, UK



signature.asc
Description: OpenPGP digital signature