Would this patch be useful...

John Taylor
Tue, 11 May 2004 15:41:32 -0000

I am considering a patch that would exclude compressing a given list
of file extensions when the -z option is used.  Users may want to use
-z, but not want to try to compress .gz, .jpg, .mp3, etc. type files.
Rsyncd has this feature with it's "dont compress" option, but I
think
many users are using rsync over ssh and therefore do not have this
functionality available to them.

The way my test code works is by modifying the set_compression() function
in token.c and using the wildmatch() function, exactly like rsyncd's
dont compress option is doing now.

If this seems useful, I want to receive input on how to implement
the user-interface.  I was thinking about two command line options,
--dont-compress and --dont-compress-from.

This is what it would look like:

rsync -z --dont-compress="*.mp3 *.gz ....."

However, since this list could be very long, you would also have:

rsync -z --dont-compress-from=/etc/rsync/already_compressed.txt

where the already_compressed.txt would have a list of extensions not to
compress.


Another option, is to have --dont-compress and --dont-compress-from use
rsync's Exclude Patterns, but I have not studied this code and do not
know how much harder this would be to implement.

Any thought?

-John