Trying to define exclude with an include list

Daryl Sayers daryl at
Fri Jun 1 04:08:08 GMT 2007

I need to backup a set of machines that are very similar in nature. I had
created an exclude list to backup everything except whats in my list. I
then used the --exclude-from=myexcludefile so rsync would not copy unwanted
files. eg:

.... long list of others

I have 2 drives on each machine and up until now I have no need to be backing
up the 2nd drive. Thats what the /u1 is for. This meant I would exclude
everything on /u1. I have now put some information in a directory in
/u1/important that needs to be backed up. My problem is that I need the
exclude list to stay generic enough to run on all machines but also backup
the /u1/important directory.
I tried converting the list to a filter like:

+ /u1/important
- /tmp
- /var/tmp
- /var/lock
- /u1

But this didnt work, then did

+ /u1/
+ /u1/important
- /tmp
- /var/tmp
- /var/lock
- /u1

This backed up /u1/important but also backued up all of /u1 as well. I then
tried an include list and an exclude list:
rsync -azH --include-from=myinclude.list --exclude-from=myexclude.list . machine:/newdest. This also failed.

Is there any way of having an exclude list but having an overriding include

Daryl Sayers                             Direct: +612 95525510
Corinthian Engineering                   Office: +612 95525500
Suite 54, Jones Bay Wharf                   Fax: +612 95525549
26-32 Pirrama Rd                          email: daryl at
Pyrmont NSW 2009 Australia                  www:

More information about the rsync mailing list