1 Answer
1

I think you can skip rsyncd and plink entirely, by rearranging your architecture a bit (which will have other benefits).

I believe that rsyncd daemon doesn't actually need to be running to do a basic rsync for backup purposes. rsync normally just connects to the other box over SSH, fires up an instance of rsync on the far side, and the two rsyncs talk to each other over ssh -- the rsyncd daemon isn't really involved. rsyncd is normally used to serve content for download by multiple clients (like a mirror server).

In this setup, I assume that the box receiving the backup (the Ubuntu box) is the more "trusted" system (from a security perspective) --- not because it's Ubuntu, but because backup servers naturally have to hold data for multiple sensitive hosts. As such, I would recommend initiating the rsync from the Ubuntu box, and setting the key trust relationship so that it's the Windows box that trusts the Ubuntu box, and not the other way around. This would mean setting up sshd under Cygwin, and locking it down (with a host-based firewall) so that only connections from your backup server are permitted.

You could then simply execute:

rsync -qrtz windowsbox:/path/to/files /path/to/ubuntu/backups

... which also demonstrates how to specify the directory on the serving side.

As the next troubleshooting step, I would drop trying to use rsyncd, temporarily leaving out key-based authentication just as you did in your earlier troubleshooting, and just try a simple rsync (of a couple of test files) using password-based authentication.

Once you get the basic sync working, you'll also want to look at rsync's --modify-window option, which will ignore the small drift in timestamps that can result from the differences in how Windows and Unix-likes handle seconds in timestamps. Otherwise, files that could otherwise be skipped will get copied over and over again.

I also strongly recommend leaving off the --delete option until after you have finished debugging and testing your solution. One typo and you can delete far more than you intended.