On Tue, Feb 06, 2001 at 11:55:43AM -0800, Jeff Kennedy wrote:
> /usr/local/bin/rsync -avz --delete /rebel-sdc/assp420 /rebel-sdc01/
> 
> and
> 
> /usr/local/bin/rsync -avz --delete /rebel-sdc/assp420/ /rebel-sdc01/
> 
> Obviously the easy answer is the "/" at the end of the source tree, but
> what is the difference to rsync?  The reason I ask is that I used the
> second version and proceeded to removed everything in the target
> directory.  There are other assp* directories under the source and
> target trees that I want to make identical (assp410, assp430, etc.).  So
> under /rebel-sdc01 there are several directory structures.  Using the
> second version of the command it removed everything under /rebel-sdc01
> and put all the data under assp420 there; I wanted it to just put
> assp420 under it.

>From the man page:

       a  trailing  slash  on the source changes this behavior to
       transfer all files  from  the  directory  src/bar  on  the
       machine foo into the /data/tmp/.  A trailing / on a source
       name means "copy the contents of this directory".  Without
       a  trailing slash it means "copy the directory". This dif-
       ference becomes  particularly  important  when  using  the
       --delete option.

- Dave Dykstra

Reply via email to