Rsync Backup Server

From DD-WRT Wiki

Revision as of 18:46, 16 September 2008 by Undertoe (Talk | contribs)
Jump to: navigation, search

Contents

Introduction and Overview

rsync is a software application for Unix systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.

In daemon mode, rsync listens to the default TCP port of 873, serving files in the native rsync protocol or via a remote shell such as RSH or SSH. In the latter case, the rsync client executable must be installed on both the local and the remote host.

Great for backing up networked computers to a central storage area. This article will explain how do setup a Rsync daemon on your dd-wrt router and have client computers in your Local network backup to them.

Compatible with Windows / Mac / Linux


Requirements

Good Howto on setting up a USB flash drive as the main /jffs/ [1]

Install Rsync on DD-Wrt

Make sure optware is setup right and that you have ushare available to you

/opt/bin/ipkg-opt update
/opt/bin/ipkg-opt list | grep rsync

returns: rsync - 3.0.4-2 - fast remote file copy program (like rcp)

/opt/bin/ipkg-opt install rsync


Basic Configuration

Create a path on your mass storage usb drive. You need to have it setup on a drive with lots of storage since it will be backing up your PC.

example: /mnt/drive1/rsync/pc1


vi /opt/etc/rsyncd.conf 

I am not sure if this is the most secure uid & gid but using uid = nobody & gid = nogroup gives me group errors. This works just fine

uid = root
gid = root
use chroot = yes
max connections = 5
syslog facility = local3
pid file = /var/run/rsyncd.pid
secrets file = /opt/etc/rsyncd.secrets

[pc1]
        path = /path/to/mass/storage/rsync/pc1
        comment = PC1 Rsync
        read only = no
        auth users = user1
 [pc2]
        path = /path/to/mass/storage/rsync/pc2
        comment = PC2 Rsync
        read only = no
        auth users = user2


Add as many rsync profiles as you need, just make sure you make a separate user for each one in the next step.


Set your share username & password

vi /opt/etc/rsyncd.secrets

Add a line for each user

user1:mypassword1
user2:mypassword2

Enable Rsync daemon

vi opt/etc/default/rsync

Change RSYNC_ENABLE=false to RSYNC_ENABLE=true


Start Rsync Daemon

/opt/etc/init.d/S57rsyncd start

Check to see if its running

ps | grep rsync

Should return

30081 root      1456 S    /opt/bin/rsync --daemon


Client Configuration - Windows

Client Configuration - OSX

Client Configuration - Linux

Questions / Comments

email undertoe at chemlab dot com