Help with complicated heirarchy exclude syntax

reader at newsguy.com reader at newsguy.com
Tue Dec 25 21:52:48 GMT 2007


Matt McCutchen <matt at mattmccutchen.net> writes:

[...]

>> I've tried lots of combination of slashes and ** but it looks to me
>> like those shown above should work.
>
> By analogy to the other case, those filter rules should exclude files
> whose names are entirely alphabetic, and they seem to be doing exactly
> that.  

I see I wasn't considering about matching directory names...

>  What were you trying to do?  If you want to traverse even
> alphabetic directories to catch any non-alphabetic files inside, prepend
> --include='/nntp/**/' (the trailing slash restricts the rule to match
> only directories) and pass --prune-empty-dirs .

That was exactly the aim yes.  I want to get at the number named files
no matter how deep and exclude any alphabet names but only actual
files.  Not directories.  Alpha named files will occur throughout the
heirarchy ... (nntp nov files) with names like .agentview or
.overview.

Maybe others from other sources such as me in there with emacs leaving
files like `121~'  or `file~' somewhere in the heirarchy.  Some are
likely to very large... the result of cat *[65]* > monsterfile

I want to move the actual news posts to an accumulative archive where
those nov files would contain all the wrong information and be a
hazard because of it.  Not to mention they can grow truely huge when a
directory may contain 10s of thousands of messages.  

And worst of all they will give many false hits to my homemade search
engines since they contain many of the messages headers on single
line.  And may have recored 150,000 messages.

Now back to the syntax at hand.. (I'm fighting my way around a rather
swollen belly due to being a hog at christmas dinner).

I wasn't sure where to `prepend' at but I've tried just about all
positions by now.

(NOTE: At the end is a find command showing the actual (partial)
  contents)

None of these seem to get to the wanted files:

    rsync  -navv --prune-empty-dirs  --exclude='/nntp/**/' \
      --include='/nntp/**[!a-zA-Z]*' --exclude='/nntp/**' \
          ~/projects/backup/rsync/nntp ./here/

   building file list ... 
   [sender] hiding directory nntp/news1 because of pattern /nntp/**/
   [sender] hiding directory nntp/news2 because of pattern /nntp/**/
   done
   delta-transmission disabled for local transfer or --whole-file
   total: matches=0  hash_hits=0  false_alarms=0 data=0
=====
   rsync   --exclude='/nntp/**/' -navv --prune-empty-dirs  \
      --include='/nntp/**[!a-zA-Z]*' --exclude='/nntp/**' \
          ~/projects/backup/rsync/nntp ./here/
  building file list ... 
  [sender] hiding directory nntp/news1 because of pattern /nntp/**/
  [sender] hiding directory nntp/news2 because of pattern /nntp/**/
  done
  delta-transmission disabled for local transfer or --whole-file
  total: matches=0  hash_hits=0  false_alarms=0 data=0
===
  rsync  -navv --prune-empty-dirs   --include='/nntp/**[!a-zA-Z]*' \
   --exclude='/nntp/**'   --exclude='/nntp/**/'  \
       ~/projects/backup/rsync/nntp ./here/
  building file list ... 
  [sender] showing directory nntp/news1 because of pattern /nntp/**[!a-zA-Z]*
  [sender] showing directory nntp/news2 because of pattern /nntp/**[!a-zA-Z]*
  [sender] hiding directory nntp/news1/comp because of pattern /nntp/**
  [sender] hiding directory nntp/news2/comp because of pattern /nntp/**
  done
  [receiver] risking directory nntp/news1 because of pattern /nntp/**[!a-zA-Z]*
  [receiver] risking directory nntp/news2 because of pattern /nntp/**[!a-zA-Z]*
  delta-transmission disabled for local transfer or --whole-file
  total: matches=0  hash_hits=0  false_alarms=0 data=0

--------
(Note these were just random test files)

  find nntp -type f
  nntp/news1/comp/lang/perl/new/old/100
  nntp/news1/comp/lang/perl/new/old/101
  [...]
  nntp/news1/comp/lang/perl/new/old/rsyncNews.ksh
  nntp/news1/comp/lang/perl/new/old/rsnap_Home_exclude~
  [...]
  nntp/news2/comp/lang/perl/old/new/100
  nntp/news2/comp/lang/perl/old/new/101
  [...]
  nntp/news2/comp/lang/perl/old/new/rsyncNews.ksh
  nntp/news2/comp/lang/perl/old/new/rsnap_Home_exclude~



More information about the rsync mailing list