Stuck with include/exclude options

David E. Meier dev at eth0.ch
Mon Jan 10 21:28:54 GMT 2005


Thanks a lot Wayne, that explains it.

I changed the --delete to --delete-excluded and appended a trailing C to
data. This way I get the desired behaviour.

However, this leads me to the conclusion I need to run rsync separatly for
any of the drives, right?

Dave

> On Fri, Jan 07, 2005 at 05:25:14PM +0100, David E. Meier wrote:
>> The directory "~data/C/test2" does not get deleted on the remote side.
>
> Which is a very good thing, because you didn't tell it to transfer
> test2, and rsync does not go around deleting things outside the
> transferred file tree.
>
> Rsync only deletes inside directories that it sends, so you'll need to
> send the whole .../C/ dir if you want rsync to delete subdirs inside it.
> If you only want to transfer some of the dirs inside .../C/, you'll need
> to use the --include/--exclude syntax to limit which directories on the
> source side get transferred.  Like this:
>
> $ rsync -avvr --temp-dir=temp --delete -e ssh --stats
>   --include=/test1/ --include=/test3/ --exclude=/*
>   /cygdrive/C/ storage at 192.168.2.111:data
>
> You can put the include/exclude statements into a file, like this:
>
> + /test1/
> + /test2/
> - /*
>
> And then use --include-from=FILE instead of the separate
> --include/--exclude options.
>
> ..wayne..
>
>



More information about the rsync mailing list