DeltaCopy

From DreamHost
Jump to: navigation, search
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this.

DeltaCopy is an open source, fast incremental backup program. Let's say you have to backup one file that is 500 MB every night. A normal file copy would copy the entire file even if a few bytes have changed. DeltaCopy, on the other hand, would only copy the part of file that has actually been modified. This reduces the data transfer to just a small fraction of 500 MB saving time and network bandwidth.

In technical terms, DeltaCopy is a "Windows Friendly" wrapper around the Rsync program, currently maintained by Wayne Davison. "rsync" is primarily designed for Unix/Linux/BSD systems. Although ports are available for Windows, they typically require downloading Cygwin libraries and manual configuration.

Configuring DeltaCopy for use with DreamHost Personal Backup

DeltaCopy can be used to schedule incremental backups from a Windows client to a Linux server running Rsync (including DreamHost's Personal Backup service). The following steps are somewhat modified from the DeltaCopy FAQ. Caveat emptor; your mileage may vary.

These instructions assume that you've downloaded and installed the DeltaCopy Client on your Windows PC.

Creating private/public keys

  1. Download CYGWIN. Although DeltaCopy comes with cygwin1.dll, you will need additional .DLLs and a couple of .EXE files.
  2. If the newly downloaded version of cygwin1.dll (C:\cygwin\bin\) is newer than DeltaCopy's version, replace the older DLL with the newer one.
  3. Start BASH - this is the console for CYGWIN
  4. At the prompt, type 'ssh-keygen'.
    • If you get a command not found error, you need to download the SSH module for CYGWIN.
    • Try installing autossh, libssh2, libssh2-devel, and libssh2_1.
  5. Enter a file name for your key-pair, e.g. /cygdrive/c/Program Files/Synametrics Technologies/DeltaCopy/sshkey. This is the default location where DeltaCopy is installed. Change the path if you have a different path on your machine.
  6. VERY IMPORTANT: When asked to enter passphrase, just hit enter. DO NOT specify a password. This should create two files (sshkey and sshkey.pub) in C:\Program Files\Synametrics Technologies\DeltaCopy folder. sshkey is your private key, where as sshkey.pub is your public key.
  7. Connect to your Personal Backups user FTP account. Create a /.ssh directory (if one doesn't exist) and put your public key (sshkey.pub) in it. Rename the file from sshkey.pub to authorized_keys; you should end up with a file called /.ssh/authorized_keys containing your public key.

Configuring DeltaCopy client

  1. Start DeltaCopy client and create a new Profile. The value for Virtual Directory corresponds to a directory off of the user's home directory on your Linux/UNIX machine, e.g. ~/testdir
  2. Click on the Options tab
  3. Check Connect via SSH
  4. Type the following in the Additional Parameters text box: -e "ssh -l b###### -i sshkey" Replace b###### with your DreamHost Personal Backup login.
    • You may have to add --protocol=29 to the Additional Parameters section if you get the error "insecure option -e". More info available here.
  5. Copy the following files from C:\Cygwin\Bin\ folder to the DeltaCopy folder.
    • cygcrypto-0.9.8.dll
    • cygminires.dll
    • cygpopt-0.dll
    • cygz.dll
    • ssh.exe
    • cygwin1.dll ( you may have done this already, but go ahead and do it again for good measure. )
  6. Finally, run the profile within DeltaCopy client to see if the transfer works.

Running Rsync the first time

If Rsync hangs, try running it from the Windows command prompt the first time in order to confirm the server connection. To copy and paste the Rsync command:

  1. Open DeltaCopy Client, right-click the profile, and choos "Display Run Command".
  2. Copy the first line beginning with "rsync.exe". E.g., rsync.exe -v -rlt -z --delete -e "ssh -l b###### -i sshkey" "/cygdrive/C/test.txt" "b######@backup.dreamhost.com:~/testdir/test.txt"
  3. Open the command prompt: Start > Run > cmd.exe
  4. Change directories to the DeltaCopy directory: C:\>cd \Program Files\Synametrics Technologies\DeltaCopy
  5. Paste the Rsync command: Alt+Space > Edit > Paste

If this is successful, DeltaCopy should be able to run from now on.