Hi.
Just curious if anyone has been able to use rsync (with the -r option) on a
macOS Sequoia machine to an OpenBSD machine.
While we all love a good thrashing of vendors screwing things up, I don’t want
to start that thread. Instead, I’m asking if there’s a simple workaround, and
providing my stupid workaround in case anyone else runs into this.
I’m asking because my (somewhat simple) rsync command started failing when
openrsync started being used on macOS with:
$ rsync --rsync-path=openrsync -a -e ssh local_path/. remote_host:/remote_path
...
openrsync: unknown option --dirs
[output of openrsync —help]
Indeed, openrsync on OpenBSD (7.6 and 7.6) don’t have a “—dirs” option, which
seems to only be used with the -r option.
Seems odd that openrsync (on Apple) -> openrsync (on OpenBSD) wouldn’t work,
but who knows what Apple has done to this under the hood, even though the man
page says:
HISTORY
The openrsync utility has been available since OpenBSD 6.5.
AUTHORS
The openrsync utility was written by Kristaps Dzonsons <[email protected]>.
The man page and options are wildly different, so I’m thinking they’ve just
pulled the guts of the protocol from openrsync and are using the samba
front-end code, but who knows.
I solved this problem by writing a stupid shell script and using that as the
executable:
#!/bin/ksh
i=0
for a in "$@"
do
case $a in
--dirs) continue
;;
*) NEWARGS[$i]="$a"
i=$((i + 1))
;;
esac
done
exec openrsync ${NEWARGS[@]}