<div class="gmail_quote">On Thu, Jul 15, 2010 at 10:03 AM, David F. Skoll <span dir="ltr">&lt;<a href="mailto:dfs@roaringpenguin.com">dfs@roaringpenguin.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;d like a way for it to require compression</blockquote><div><br></div><div>You could try using a &quot;pre-xfer exec&quot; script, which lets you look over the users options in the environment variables.  For instance, there&#39;s a z in here, even when -s (--protect-args) is used:</div>
</div><div><br></div><div>RSYNC_ARG3=-vogDtprIze31.12iLs</div><div><br></div><div>If you make a script that scans the arg variables and exits with an error code when z is not found, rsync will refuse the transfer.  Just be careful not to look for letters in an arg value.</div>
<div><br></div><div>A simple perl script that works:</div><div><br></div><div><div>#!/usr/bin/perl</div><div>use strict;</div><div># arg 0 is the rsyncd script, so start with arg 1</div><div>for (my $j = 1; $j &lt; 1024; $j++) {</div>
<div>    my $var = &quot;RSYNC_ARG$j&quot;;</div><div>    my $val = $ENV{$var};</div><div>    exit 1 unless defined $val;</div><div>    # These single-char letters that have no arg were filched from support/rrsync script:</div>
<div>    exit 0 if $val =~ /^-[ACDEHIKLORSWXbcdgklmnoprstuvx]*z/;</div><div>}</div><div>exit 1;</div></div><div><br></div><div>..wayne..<br>
</div>