Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently using sftp to download nightly backups (.tar.gz) from my web host to my desktop computer. I think I'd like to switch to rsync to minimize the bandwidth (and time). I have cygwin installed on my PC, but don't use it for much. I have shell access to my web host via ssh (PuTTY).

Let's say my source directory is myserver.com:/home/username/backups/, I want to grab all of the .tar.gz files from there, and I want to save them to C:\Backups\ locally.

share|improve this question

2 Answers 2

Use the built-in rsync on the *nix box, and DeltaCopy on the Win32 box.

share|improve this answer
    
Actually, I tried DeltaCopy, but it wasn't able to connect to the remote server. Do you know how to get it to connect over ssh? –  Nogwater Jun 4 '10 at 16:18
    
In the DeltaCopy Client, setup the remote server as you normally would, and under the options tab make sure 'Connect via SSH' is checked. You must have SSH keys setup so it can connect without a password. There's little guide here: aboutmyip.com/AboutMyXApp/DisplayFAQ.do?fid=1 NOTE: it says it's for moving file to *nix only, it means that it's for connecting to a *nix daemon only. –  Chris S Jun 4 '10 at 17:58
    
Oh SSH keys, I'll need to find out if that's possible with my host. I'll let you know how it turns out. Thanks for the pointers. –  Nogwater Jun 5 '10 at 4:41
    
Thanks for the pointer. I ended up not using DeltaCopy, but your link definitely helped me get pointed in the right direction. –  Nogwater Jun 5 '10 at 17:39

I was able to get this working with cygwin's rsync and ssh. Here's the command I ended up with:

C:\cygwin\bin\rsync.exe -vcr -e "ssh -l username -i /cygdrive/C/Backups/sshkey" "myserver.com:/home/username/backups/" "/cygdrive/C/Backups/rsync/"

Here were some issues along the way: Added C:\cygwin\bin\ to my Windows PATH. I don't know if this was strictly necessary, but it helped me.

Chris S's link to create the key pair that's needed to allow ssh to connect without using a password.

I also needed to set some permissions of the newly created .ssh directory and file on the server...

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys/

Oh, and I needed to manually locally create ~/.ssh within cygwin.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.