downloading only specific directories from directory tree

Kevin Korb kmk at
Fri Jan 20 23:15:00 UTC 2017

An include only overrides an exclude that follows it.  So, you would
need something like this:

+ */
+ openSUSE_13.2/***
- *

Then add --prune-empty-dirs to your rsync command line.  I left off the
initial ** because it doesn't really mean anything unless openSUSE_13.2
isn't always the entire directory name in which case 1 * would do.

Another way to explain it is that by default everything is included.  An
exclude rule makes exceptions.  An include rule makes exceptions to the
exclude rule.

On 01/20/2017 06:08 PM, Istvan Gabor wrote:
> Hello:
> I have read rsync manual and several howtos on how to use rsync, still
> I don't know if it's doable what I want to do, and if yes, how.
> The scenario:
> I would like to make a local copy of openSUSE 13.2 repositories.
> I use openSUSE linux.
> The repos are located in a multi-level directory structure, eg:
> Let's call this directory the root dir.
> Each directory in the root has subdirectories, and one of the
> subdirectories
> is named "openSUSE_13.2". The openSUSE_13.2 dir can be one, two, or more
> level
> downstairs in the root dir, eg:
> There are plenty of directories in the root dir, and each subdirectory can
> have several subdirectories.
> Is it possible, using rsync, to download only all "openSUSE_13.2"
> directories with
> their contents, without specifying directly one by one every subdirectory
> to be included or excluded?
> I tried to use filters.txt file with content:
> + **openSUSE_13.2/***
> with this command:
> rsync -av --include-from=filters.txt
> rsync:// ./
> This downloads every directory. How can I exclude those are not
> openSUSE_13.2?
> Thanks,
> Istvan

	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at  (work)
	Orlando, Florida		kmk at (personal)
	Web page:
	PGP public key available on web site.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the rsync mailing list