Rsync backup with Vista

10/29/2008 Charles Roth

Introduction: the problem

Solution
Looking under the hood of DeltaCopy, I found that it already contains all the key parts of Cygwin needed to do rsync vis ssh -- no additional Cygwin install is needed.  So some very simple hacking, and one batch file, are all that is needed to get rsync backup working.

  1. Download and install DeltaCopy.  Do not enable the DeltaCopy server, we're only going to use pieces of the client.  (We won't actually use the provided DeltaCopy client, either.)
  2. Create keys.  On the linux server, create a new key with ssh-keygen.  Just type "ssh-keygen", and press Enter at all the prompts.  (In particular, you must use an "empty" passphrase.)
  3. Copy keys to DeltaCopy folder.  From the linux server, copy .ssh/id_rsa to C:\Program Files\Synametrics Technologies\DeltaCopy\sshkey.  Similarly, copy .ssh/id_rsa.pub to C:\Program Files\Synametrics Technologies\DeltaCopy\sshkey.pub.
  4. Copy public key to linux userid.  Copy the id_rsa.pub key to .ssh/authorized_keys in the target userid on the (to-be-backed-up-to) linux server.  Make sure that .ssh has "700" permission.
  5. Create backup batch file.  The backup will be performed by a Windows batch file, that needs no user interaction (other than to start it).  The specifics depend on exactly what is being backed-up where. 

    For example, suppose I wish to backup the Windows Vista user jdoe's Documents directory, to the userid "backupjdoe" on the linux server myhost.com.  I would create a batch file, e.g. "backup.bat", that looks like:

       cd \Program Files\Synametrics Technologies\DeltaCopy
       rsync -avz -e "ssh -i sshkey" /cygdrive/c/Users/jdoe/Documents backupjdoe@myhost.com:.
    
  6. Run as Administrator.  Depending on exactly what you are backing-up, you may find it necessary to run the batch file with full Administrator rights.  To do so:
    1. Create a shortcut from the batch file, onto the desktop.
    2. Right-click on the shortcut.
    3. Select "Advanced".
    4. Check "Run as Administrator".
  7. Scheduling automatic backups.  More to come on this one...

Feedback
Ola Lindberg notes:

I used to run Rsync on my WinXP box but since I moved to Vista I had some problems using it (for example international chars would fail) so I looked around and found Robocopy.  If you are running into Rsync-Vista problems and you can set up your computers to copy to a file share (smb) instead of via ssh I think robocopy would work fine for you as well.

I use the following to copy my files with Robocopy: robocopy source destination /MIR