Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've had to break my rsync tasks down into smaller jobs given the size of my directories. Essentially, I'm doing it alphabetically (i.e., script that syncs folders starting with A-D, E-H, etc, etc).

The issue I'm having is A-D filter.txt file works fine, but all of the others fail. I believe the issue is because the path that I'm syncing is:


My filter.txt file for A-D looks like this:

- E*
- e*
- F*
- f* (etc all the way through Z)
+ */db/
+ */db/Backups/***
- *

The one above works with no issue. However, this one does not:

- A*
- a*
- B*
- b* 
- C*
- c*
- D*
- d*
- I*
- i*
- J* (etc all the way through Z)
+ */db/
+ */db/Backups/***
- *

I'm guessing my exclusion of either d or B is causing this (it's excluding the db folder or the Backups folder??) but I can't figure out why since I have an include for */db/ and /db/Backups/**

Thank you!!

share|improve this question
up vote 2 down vote accepted

rsync filters work on the first match that is found - so yes, your excludes of "d*" and "B*" are excluding your "db" and "Backups" subdirectories before your include matches.

You'd be better off just including the specific paths you want included, and then excluding everything else, e.g.:

+ /[E-H]*            # include top-level dirs starting with E through to H
+ */db/              # include "db" subdirectories
+ */db/Backups/      # include "db/Backups" subdirectories
- */                 # exclude all other directories
share|improve this answer
Worked perfectly - thank you! – Jason Feb 25 '13 at 15:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.