Trouble with include/exclude patterns
maxb at ukf.net
Thu Feb 6 12:17:34 EST 2003
Anand Buddhdev wrote:
> I'm using rsync 2.5.4 on my RedHat 7.3 client laptop and rsync 2.5.5
> on my RedHat 8.0 server. On the client, I have a directory "rpm" with
> 5 subdirectories, out of which I only want to copy the one called
> across. I also have another directory ".mozilla" out of which I want
> copy across 2 files. I have constructed the following rsync
> rsync -e ssh -av --delete \
> --exclude='/rpm/BUILD' --exclude='/rpm/SOURCES'
> --exclude='/rpm/SPECS' --exclude='/rpm/RPMS' \
> --include='.mozilla/arb/kfgj0v2y.slt/bookmarks.html' \
> --include='.mozilla/arb/kfgj0v2y.slt/prefs.js' \
> --exclude='.mozilla' \
> .mozilla \
> rpm \
> Now, this works correct for the "rpm" directory, by only copying
> rpm/SRPMS, and leaving out rpm/BUILD, rpm/SOURCES, /rpm/SPECS and
> However, it does not copy my bookmarks.html and prefs.js files. If I
> add one more -v to the rsync command, I see this:
> excluding directory .mozilla because of pattern .mozilla
> So it seems the entire .mozilla directory is skipped, despite my 2
> --include statements.
> I have read the man page over and over, and I can't see what's wrong.
Yes, its messy.
I don't think there is a better way.
> Any idea what I'm doing wrong? And any ideas on reducing those 4
> --excludes to one --exclude and one --include for the rpm directory?
do what you want?
More information about the rsync