I'm trying to rsync a directory structure and it's contents to another
machine. I want to make sure that the entire toplevel part of the
directory structure is created at the remote site, since it may not exist.
top: A/ B/ C/
under B/: 1/ 2/ 3/
under 2/: x/ y/ z/
all of this is located in /top/level/dir on the source system.
I want to send "B/1/y" and it's contents to the remote site, but I
want
it to preserve that structure, creating it if it doesn't exist at the
remote site. I do not want any other part of the tree.
I made an include file as follows:
+ /B/
+ /B/2/
+ /B/2/y/
+ /B/2/y/**
- *
when I include this, nothing is transferred. The structure does not
exist on the remote server. Here's the command-line:
rsync -rvzd --include-from=incfile /top/level/dir remote::share
If I remove the '- *' from the include, it transfers everything under
/top/level/dir.
If I use --from-file and list all the included paths as follows and use
an exclude='*', I can get it to copy over. I've done tons of
iterations
on this, so forgive me for not remembering exactly which arguments I
used with --from-file..
/B/
/B/2/
/B/2/y/
I have tried removing the terminating slashes, adding them, removing the
front slashes, and lots of other combinations for the incfile.
I'm using rsync 2.6.6 under RedHat Linux Enterprise 3.0.
Thanks!
-Eric