Have your main windows batch file start 2 sub batches - the first batch
file starts plink directly. Have it execute a sleep command and have it
set up a forwarding tunnel. This can be done with a .ppk file so it is
automatic. It does not have to connect as root on the server as long as
the server will allow the client to port forward. Have the second batch
fire up rsync pointed at the local host:port that you're forwarding.
Make sure the rsync password is in the local environment first. As long
as rsync is sending traffic back and forth, it will keep the tunnel open
after the sleep command exits.
Obviously, timing between the 2 processes is critical. You will have to
test and adjust as needed to get the tunnel open before rsync starts,
hold it open long enough for the rsync to connect, and then repeat the
whole process in case the initial transfer crashes.
It's not pretty, but I've had something like this working for years.
I'd
have to pull it apart to get more specific. I actually pieced it
together from info found with google.
Good luck,
Bill Uhl
GreenLight Networks, LLC
Max Kipness wrote:> Hello,
>
> I've already tried asking at the cwrRsync forums with no luck yet, so I
> thought I would try my luck here.
>
> According to the rsync man pages, with the -e option you can use other
> remote shells, and I had thought plink was one of them, but I could be
> wrong. I can't seem to find any information anywhere about the proper
> syntax. What I've been trying, are all kinds of combination close to
the
> following:
>
> rsync.exe -e "plink.exe -l username -pw password" --stats
--compress
> --recursive --archive --delete-after --files-from=backup_selections.txt
> /cygdrive/c server_address://backup/Current
>
> I've tried adding options -batch and -N as suggested by someone else to
> no avail. I basically want to use rsync without a password or keys and
> yes, I'm aware of the security implications.
>
> Any suggestions would be much appreciated.
>
> Thanks,
> Max
>