DevHeads.net

Rsync + Windows 7 - backing up to linux server

Greetings,

I have successfully been using rsync to backup my Linux desktop and laptop
for several years.

My current goal is to automatically backup a Windows 7 desktop to a linux
server using rsync. I've found guidance here:
<a href="http://www.gaztronics.net/rsync.php" title="http://www.gaztronics.net/rsync.php">http://www.gaztronics.net/rsync.php</a>

I have installed Cygwin along with the rsync option.

For the Windows 7 machine I've written a short batch file who's critical
line reads as follows:
c:\cygwin\bin\rsync -vrtz -e "c:\cygwin\bin\ssh -i
/home/someuser/.ssh/id_rsa" /cygdrive/b
someuser@leeloo:/var/backup/arrakis

It almost works as intended. I can run it from the Windows 7 machine by
doubleclicking the file, or running it from a Command window. In either
case, I need to be authenticated by my Linux machine.

I would like to have the script run automatically from Windows 7 Task
scheduler w/o having to sit there and authenticate the process.

The Gaztronics article suggests a process; to that end I've modified the
above line to read:
c:\cygwin\bin\rsync -vrtz -e "c:\cygwin\bin\ssh -i
/home/hanya/.ssh/id_rsa" --password-file=c:\cygwin\secret /cygdrive/b
deckard@leeloo::arrakis

However, I'm still required to authenticate. And I get the following
errors/noise:
rsync: unable to open configuration file "rsyncd.conf": No such file or
directory
rsync error: syntax or usage error (code 1) at clientserver.c(498)
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at
/home/lapo/packaging/rsync-3.0.7-1/src/rsync-3.0.7/io.c(601)
[sender=3.0.7]

However, there is a rsyncd.conf file at the both the client and the server
end.

Any help would be appreciated greatly.

Much thanks.

Max Pyziur
<a href="mailto: ... at brama dot com"> ... at brama dot com</a>

Comments

Re: Rsync + Windows 7 - backing up to linux server

By Larry at 08/22/2010 - 20:58

Max Pyziur wrote:

The above does not look right. The path to the key would need to be on
the machine calling rsync, in other words the Windows box. That being
said /home/someuser/.ssh/id_rsa wouldnt be the correct path.

Re: Rsync + Windows 7 - backing up to linux server

By Max Pyziur at 08/22/2010 - 21:50

That part of the line works. Until I generated the correct key (ssh-keygen
-t rsa -b 2048), I kept getting error messages that the key couldn't be
found.

This isn't the problem.

The problem is that the backup machine (a Linux box) requests
authentication from the Windows 7 machine when the Windows 7 machine
initiates the rsync script to backup contents to the linux box.

Max Pyziur
<a href="mailto: ... at brama dot com"> ... at brama dot com</a>

Re: Rsync + Windows 7 - backing up to linux server

By Mail Lists at 08/22/2010 - 22:09

A couple things to try maybe ..

(i) run ssh-agent on the windows box (its in cygwin too I think) -
human auth to that and then run script (not sure if this is ok for your
needs or not)

(ii) fully automatic no human auth required - you'd need to (create
and ) use raw unencrypted key and put the pub part as usual in the
authenticated_keys file on linux machine ... if the key is encrypted
then a human will be asked for a pass phrase - whether its cached in the
agent or not.

gene/