rsync exclude/include

Wayne Davison wayned at users.sourceforge.net
Wed Nov 14 03:54:15 EST 2001


On Tue, 13 Nov 2001, Thomas Schweikle wrote:
> I am calling rsync using
> 
> rsync -avz --include-from="include" --exclude-from="exclude"
> ftp3.sourceforge.net::/netbsd/iso iso/

Looks like you didn't copy that command exactly, because rsync would
fail with a syntax error due to the '/' before the netbsd module name.
Also, you're creating an iso dir inside your local iso dir, which is
probably not what you want.  With the include/exclude file Dave gave
you, you'd need to run this command (changing "iso/" into "."):

rsync -avz --include-from=foo ftp3.sourceforge.net::netbsd/iso .

However, I'd suggest one a little simpler:  add a trailing slash to the
root directory you're requesting and you can leave off the references to
it (and put the data wherever you like, even if the directory isn't
named "iso").  You would run this command:

rsync -avz --include-from=foo ftp3.sourceforge.net::netbsd/iso/ myiso

And put this into "foo":

+ /1.5.*/
+ /1.5.*/i386*
- *

You'll note I also used a trailing slash for the directory include since
I don't want any files that match to be included (there are none here,
but it's a good general principle).

..wayne..





More information about the rsync mailing list