[Linux-disciples] Rsync includes and excludes
Stephen R Laniel
steve at laniels.org
Tue Sep 27 11:20:49 EDT 2005
On Tue, Sep 27, 2005 at 11:13:47AM -0400, Adam Rosi-Kessel wrote:
> Why can't you just do:
> rsync -r ~/private/consulting_gigs remoteUser at domain.com:
Well, that was just a simplified example of what I want to
do. Really what I'm trying to do is
rsync --exclude-from file1 --include-from file2 / remoteUser at domain.com:
where the include and exclude files could potentially
contain many patterns.
> Have you read the INCLUDE/EXCLUDE PATTERN RULES part of the rsync manpage?
Yep. It didn't help. This is the relevant part:
rule. For instance, this wont work:
+ /some/path/this-file-will-not-be-found
+ /file-is-included
- *
This fails because the parent directory "some" is excluded by the * rule, so rsync never visits any of the files
in the "some" or "some/path" directories. One solution is to ask for all directories in the hierarchy to be
included by using a single rule: "+ */" (put it somewhere before the "- *" rule). Another solution is to add spe
cific include rules for all the parent dirs that need to be visited. For instance, this set of rules works fine:
+ /some/
+ /some/path/
+ /some/path/this-file-is-found
+ /file-also-included
- *
which confuses me, because that's basically what I'm doing.
I have --exclude-from=exclude, which contains only '**',
then --include-from=include, which contains a list of paths
to back up. Whether I do
rsync --exclude-from=exclude --include-from=include
or switch the order in which exclusions and inclusions are
processed, it doesn't work.
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050927/0a2575a4/attachment.pgp
More information about the Linux-disciples
mailing list