On Fri, 26 Mar 2004, Phil Howard <[EMAIL PROTECTED]> wrote: > > So I have on my server a big file tree. I want to use rsync to download > only the PDF files, which make up a small portion of that tree. So I try > it this way: > > rsync -aHPvz --include '*.pdf' --exclude '**' [EMAIL PROTECTED]:<source> > <destination> > > which gives me nothing.
Hi Phil, Your goal seems to be to create a tree that consists only of *.pdf files and their necessary directory nodes. Right? The closest you can get to that with standard includes/excludes is with this combination: --include '*/' (process/create all directory nodes) --include '*.pdf' (include all *.pdf files) --exclude '*' (exclude everything else) The disadvantage is that you will get the entire tree, even the branches with no pdf files. rsync 2.6.0 has a new 'files-from' option which will do what you need, but you have to create the file list yourself (easy enough to do with the 'find' command). But you are at a disadvantage in that you are doing a pull and may not have access to the source. Here's a possibility. Do a --dry-run first to determine the names of the pdf files. Grep the -v output of rsync for '\.pdf$', store that list in a file, then do a real run with the files-from option. I didn't try this - so I haven't verified that this will work. -- John Van Essen Univ of MN Alumnus <[EMAIL PROTECTED]> -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html