Cygwin/rsync/ssh automation problems

Josh Endries jendries at
Fri Oct 3 11:39:18 EST 2003

Hey all,

I have a problem I can't find a solution for. I am on my third day of testing,
researching, planning, and swearing. :) I need to set up a convenient way to
synchronize a bunch of data over the network for backups. The server is
FreeBSD and the client is Windows. Currently we are using PuTTY, Pageant, and
PSCP to SCP the files over SSH. This has various problems which led me to look
for better ways to synchronize the files, so of course I am looking into
rsync! I am having considerable trouble getting this to work in an automated
way because of the requirements:

	* Windows client -> FreeBSD server
	* Must be convenient/easy (the Windows user isn't a guru)
	* Must be encrypted and authenticated well (hence SSH)
	* Must work through a firewall (opening a port is fine)
	* Must be automated "behind the scenes" and run late at night

Like I said, currently we use a Windows Scheduled Task that runs a batch file
that simply runs something like "c:\path\pscp.exe -options source
destination". This works well because the PuTTY programs (including PSCP) use
Pageant as an ssh-agent, so the WIndows user only needs to enter the RSA key
once when they start the computer/agent, not every time it connects to
transfer. Obviously, with lots of files, this is much more inefficient than
rsync and is causing some problems.

I'm testing rsync and SSH through Cygwin. I first tried rsync normally,
through SSH (-e ssh), and it works fine. This brings me to the next hurdle:
automation. In order to do this, I need an agent running with a loaded key.
Since Pageant works for SCP, I tried "rsync -e putty" (and plink) and it seems
unable to talk to Pageant when running under rsync. It always asks for my
password. Maybe this has something to do with the Cygwin environment. I tried
SSH port forwarding and using authorized_keys to start an rsyncd upon connect,
and that didn't work either. I've tried a lot of stuff and it all blurs
together now.

I've spent considerable time trying to get ssh-agent to run in the background
and/or be available to rsync so I can run it from a batch file or in a
Scheduled Task. I tried to install ssh-agent as a service using cygrunsrv and
the service won't start (something about not starting in a timely manner?). I
even tried replacing the explorer shell with an "ssh-agent.exe explorer.exe"
shell in the registry (similar to what I do with X on my PC). While it was
amusing to reboot and get nothing but a file explorer window, that won't work
either. :(

So I'm now running out of ideas, and haven't found any useful information on
the net. Is there anyone out there that successfully got something like this
to work? Any ideas what I can try, what I may be doing wrong, or a better way
to do this (other than reinstalling a certain OS)?

Thanks a lot for any advice,
Josh Endries

More information about the rsync mailing list