<div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 12, 2022 at 12:23 PM Dr. Mark Asbach via rsync <<a href="mailto:rsync@lists.samba.org">rsync@lists.samba.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there, hi past me,<br>
<br>
> My (non-working) attempt:<br>
> […]<br>
> So it seems the "-l" is dropped into the void letting ssh assume USER was the target host? I don’t actually get what I can do.<br>
<br>
Turns out, I have to write down the description of my issue and then send the email before I magically understand the solution ;-)<br>
<br>
Here’s a working example that does not need a wrapper script:<br>
<br>
PASSWORD=<SUDOPASS> rsync -vv --delete-after --delay-updates '/bin/sh -c "{ echo $PASSWORD; cat - ; } | ssh -i ~/.ssh/id.key $0 $* &"' --rsync-path='sudo -S rsync‘ ./SRCDIR USER@HOST:DSTDIR<br>
<br>
The trick was actually to add "$0" because $* will drop the first argument from the list as this typically is the name of the script itself (duh!).<br>
<br>
Hope this is of help to anyone,<br></blockquote><div><br></div><div>Cool, glad you found a solution you're happy with.</div><div><br></div><div>Bear in mind, putting a password in an environment variable can be seen by other users on the same system with "ps auxwwe".</div><div><br></div></div></div>