Backup Secrets

Best practices for Windows administrators

Featured Contributors

There are no featured contributors yet.

Installing Rsync on Windows or Linux Servers

August 4, 2010, 9:35 pm

Summary: This article outlines how to setup and install Rsync on a Linux or Windows Server.

Installing Rsync on Windows or Linux Servers

What is Rsync?

Rsync is an open source software application, originally written for Unix systems, but now also running on Windows and Mac platforms. It is used to synchronise files and directories from one location to another while minimizing data transfer between each location.

The data transfer is minimised using an algorithm that will transmit, roughly speaking, only the parts of the files that have changed, right down to the bit level. (This technology is also known as in-file delta incremental transfer.) Along with this minimised data transfer Rsync also compresses all data packets sent, further reducing transfer overheads.

Visit http://en.wikipedia.org/wiki/Rsync to learn more about Rsync.

Where can I install Rsync?

As Rsync is an open protocol, you have two main options when it comes to storing your data on an Rsync enabled server:

  1. Third-party Datacenters that support Rsync, such as Amazon S3 Rsync or RSync.net
  2. Do-it-yourself - any Rsync Server - such as an Rsync-enabled NAS device, Windows or Unix machine.

3rd party datacenters have the advantage of high availability networks, and some datacenters also offer geo-redundant storage. The do-it-yourself approach has the advantage that data remains in your control, and a lack of monthly hosting fees or limits to the amount of data backed up. Using your existing internet connection and hardware can be a cost effective solution. A popular choice of destination is an Rsync-enabled NAS device.

Daemon mode vs. Rsync over SSH

Rsync servers can be on of two different types:

Windows and Linux data hosts generally support Rsync over SSH. However, some NAS devices do not, and Daemon mode must be used instead. Daemon mode is still an acceptable solution provided a secured LAN/WAN (such as site-to-site VPN) is used.

Setting up a Windows machine to act as an Rsync Server

To use Rsync with an SSH tunnel you will first need to install both SSH and Rsync on your Windows machine. We suggest the use of CopSSH and cwRsync. We have put together a combined installer for cwRsync Server 3.0.1 and CopSSH that can be downloaded here.

Prerequisites

Installing CopSSH and cwRsync

  1. Run the CopSSH/cwRsync installer.
  2. Continue through the install wizard, installing the package to any location you choose.
  3. During the installation you will be presented with the following popup. We suggest leaving the SvcCWRSYNC account name as is.

  4. Later in the installation you will be presented with the below popup. At any time after the install you can access "Activate a user" from your start menu to give SSH access to that user. You must activate at least one user before you will be able to register an Rsync client. Click "OK" to continue your installation.
    • DO NOT ACTIVATE YOUR ADMINISTRATOR ACCOUNT.
      Doing so will cause a lock down on the account due to CopSSH's security settings. We recommend activating a newly created account.

Activating a user

If you are planning to use SSH, then before you register a client with your Rsync server, you must activate a user with CopSSH. In the start menu, under All Programs > CopSSH, select "Activate a user". You will be presented with the screen below. Select a user and hit next. You will be prompted to enter a passphrase which can be any text string.

DO NOT ACTIVATE YOUR ADMINISTRATOR ACCOUNT
Doing so will cause a lock down on the account due to CopSSH's security settings. We recommend activating a newly created account.

Your user's home directory will be located at (for example) C:\Program Files\ICW\home\justin. The location of this directory can be changed by editing the file C:\Program Files\ICW\etc\passwd.

Setting up a Linux machine to act as an Rsync Server

Most FreeBSD and Linux servers can be used to host data using Rsync. All major Linux distributions (such as Fedora, RedHat Enterprise, Ubuntu, Debian) have SSH server and Rsync available as install options. The most common SSH server is OpenSSH.

To determine if your system has these prerequisites installed, log into your system and start a shell. Then type:

man rsync - this should return the man page for Rsync if installed. Type 'q' to exit the man page.
man sshd - this should return the man page for sshd if installed. Type 'q' to exit the man page.

If not installed, you should use your distribution's software package manager to install these packages. Most commonly they can be found under the "Server" or "Security" categories.

Creating logons on your data host

The next step is to create logons on your data host. We recommend creating a separate logon for each connection. For example, if you host data for 5 different companies or office, create 5 different accounts so that each will only be able to see their own data.

You should also make sure that each user's home directory is on a partition that contains sufficient space to host their data. You must also change the permissions on each user's home directory, or else most SSH daemons will not allow you to connect to the server using the public/private key method. To do this, use the chmod command - for example for a user "fred", type in the following (when logged on as root):

chmod 700 /home/fred

Setting up a NAS to act as an Rsync Server

Backing up to an Rsync-enabled NAS can be a very effective solution. The advantage of using a NAS is that as an appliance, it can be close to a turnkey solution and easier to manage.

Each NAS is different, and some support Rsync over SSH, whereas others only support Rsync Daemon mode. There is however a list of requirements that must be met in order to connect to the device. To use your NAS as an Rsync data host you will need:

Many of these options vary from device to device, so you will need to consult your manual to correctly setup the destination.

Configuring an Windows client to send data to an Rsync Server

You can install cwRsync on your Windows machine to have the Rsync libraries necessary to transfer data to your Rsync Server. The latest version of cwRsync can be downloaded here: http://sourceforge.net/projects/sereds/files/cwRsync/. To read more about cwRsync visit http://www.itefix.no/i2/node/10650

User Comments:
    No user comments so far
Please post a comment