purge-empty-dirs and max-file-size confusion

Ian! D. Allen idallen at idallen.ca
Fri Apr 24 18:19:42 GMT 2009


On Fri, Apr 24, 2009 at 07:51:35AM -0700, Wayne Davison wrote:
> This is because --min-size is a transfer rule, not an exclude rule.

There is no mention of the concept of "transfer rule" in the rsync
man page.  I offer some proposed man page wording changes, below.

The man page says "This option tells the receiving rsync to get rid of
empty directories from the file-list" - there is no mention that there
must be two *kinds* of empty directories in the file list: (1) empty
directories created by filter/exclude rules and (2) empty directories
created by "transfer" rules.  Or perhaps (2) doesn't really exist, but the
sending rsync simply never gets around to sending the files that it says
should be in those directories and so the receiving rsync does all that
directory creation work but the promised files never arrive to fill them.

> There is not currently a way include/exclude files based on size in rsync.

That is most awkward, given that --min-size sure sounds like it behaves
this way.  It is an annoyingly fine distinction to say that "exclude"
and "avoid transferring" are two different kinds of operations when it
comes to rsync pruning empty directories.  This needs to be made much
clearer in the man page.  I offer these slightly reworded paragraphs:

-m, --prune-empty-dirs
      This option tells the receiving rsync to get rid of empty
      directories from the file-list, including nested directories that
      have no non-directory children. This is useful for avoiding the
      creation of a bunch of useless directories when the sending
      rsync is recursively scanning a hierarchy of files using
      include/exclude/filter rules. It does not prevent the creation of
      empty directories that result from the use of transfer rules such
      as --max-size or --min-size, since transfer rules do not affect
      the file-list.

--max-size=SIZE
      This transfer rule tells rsync to avoid transferring any file that
      is larger than the specified SIZE.  Unlike a filter/exclude rule, it
      does not affect the file-list, so --prune-empty-dirs will not work
      with this option.

--min-size=SIZE
      This transfer rule tells rsync to avoid transferring any file
      that is smaller than the specified SIZE, which can help in not
      transferring small, junk files.   Unlike a filter/exclude rule, it
      does not affect the file-list, so --prune-empty-dirs will not work
      with this option.

Thanks for keeping rsync alive and kicking!

-- 
| Ian! D. Allen  -  idallen at idallen.ca  -  Ottawa, Ontario, Canada
| Home Page: http://idallen.com/   Contact Improv: http://contactimprov.ca/
| College professor (Open Source / Linux) via: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/


More information about the rsync mailing list