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: /tmp /var/tmp /var/lock .... long list of others /u1 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 first? -- Daryl Sayers Direct: +612 95525510 Corinthian Engineering Office: +612 95525500 Suite 54, Jones Bay Wharf Fax: +612 95525549 26-32 Pirrama Rd email: daryl@ci.com.au Pyrmont NSW 2009 Australia www: http://www.ci.com.au
On Fri, Jun 01, 2007 at 02:08:08PM +1000, Daryl Sayers wrote:> + /u1/important > - /tmp > - /var/tmp > - /var/lock > .... > - /u1The man page talks about how the exclusion of the parent directory short-circuits the directory traversal, and the u1 dir is never even visited (giving the include nothing to match). You need something like this: + /u1/ + /u1/important - /u1/* ..... That way rsync can get into the dir, match what you want, and exclude everything else. ..wayne..