Seems complicated.
I was suggesting something like adding a general purpose 'rsync_options' variable in that section of weewx.conf, and adding the value to the assembled rsync command in the run(self) routine in rsyncupload.py ? Then the user could add any combination of the rsync options to the command if needed. Perhaps something like the following (untested):
pi@pi4:/tmp$ diff rsyncupload.py.orig rsyncupload.py -u
--- rsyncupload.py.orig 2024-04-02 08:18:48.311469290 -0700
+++ rsyncupload.py 2024-04-02 08:19:57.970078706 -0700
@@ -46,6 +46,7 @@
self.delete = delete
self.port = port
self.ssh_options = ssh_options
+ self.rsync_options = rsync_options # <== new
self.compress = compress
self.log_success = log_success
self.log_failure = log_failure
@@ -96,6 +97,7 @@
if self.timeout is not None:
cmd.extend(["--timeout=%s" % self.timeout])
cmd.extend(["-e"])
+ cmd.extend([rsync_options]) # <=== new
cmd.extend([rsyncsshstring])
cmd.extend([rsynclocalspec])
cmd.extend([rsyncremotespec])
And add a rsync_options = "whatever you want here" to the [[RSYNC]] section in weewx.conf ala:
[[RSYNC]]
delete = 0
skin = Rsync
enable = true
server = x.x.x.x
user = myremoteuser
path = /my/remote/path/here
log_success = true
log_failure = true
rsync_options = "-x -y -z whatever" # <=== new
Disclaimer - totally untested and no idea if there are security risks of doing it this way, but it would seem to be about as flexible as you can get toward supporting whatever rsync options the underlying os supports with a minimum of change to the existing uploader....