Rsync Daemon Mode with LuckyBackup

I wanted to setup a full backup solution of my home server with my documentation wiki. At the base level rsync looks like the best candidate and for the client GUI I selected LuckyBackup which is included in the standard Ubuntu repository. In order to consume little resources in an in house network, I selected the inetd daemon mode on the server side. If you operate via Internet, you should use SSH for security reasons.

Setup Rsync Daemon with xinetd on server side

The rsync daemon needs its own configuration file rsyncd.conf. In order to work with sudo rights a file rsyncd.secrets with the sudo password is needed. Because the rsync daemon is started via xinetd daemon, it needs the configuration file rsync.
The user and group must be root in order to get a full backup with root permission. The rsync module name is clone.

Connecting to the rsync daemon

To connect to rsync when it is running as a daemon, instead of use a colon as we do when using SSH, we need to use a double colon, followed by the module name, and the file or folder that we want to copy or synchronize, we can use:

rsync -rtv user@host::module/source/ destination/
rudi@rudiswiki:~$ sudo rsync -rtv rudi@  /clone/

Just remember that the user that appears there is one of the users that we defined in /etc/rsyncd.secrets and not a user of the host computer. What is a bit tricky are the passwords, the first is the sudo password, the second is the remote password.

rsync version

rudi@rudiswiki:~$ rsync --version
rsync  version 3.0.7  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site:
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes

LuckyBackup 0.4.4

In order to backup the rudiswiki hard disk RAID1 array to a backup hard disk via network, the program LuckyBackup with underlaying rsync is used. Then you have a third independent hard disk, just in case of a dramatic failure.
Note: Version 0.3.5 which comes with Ubuntu 10.04.1 has a problem, which locks the program if folder /proc is selected for exclusion. Version 0.4.4 does not have that problem.

The benefit of luckyBackup is, that you can activate a simulate (Dry) mode and see what is in the protocol window. That can help to avoid misunderstandings. The setup for a remote rsynch connection via network is very good made. Also an extensive manual is available on line, see at the links.

On the server rsync is setup as a daemon, started via xinetd network service.

If the third 250 GB spare hard disk has set the raid mark in the directories, it will not be mounted automatically in Ubuntu, but it make swapping with a RAID1 hard disk easier. In order to use luckyBackup you have to mount the partitions before use, if it is not auto mounted.

# If there is not already a destination directory provided, it must be created.
$ sudo mkdir /media/MX250

# mount the system disk, adopt /dev/sdxn to your system
$ sudo mount -t ext3 /dev/sdc3 /media/MX250

# mount the boot partition
$ sudo mount -t ext2 /dev/sdc1 /media/MX250/boot

For documentation purpose I will list all Task properties, in case of a remote rsync, Source has the rsync module name of the server setup:

Task Name: clone_rudiswiki
Type: Backup the entire directory (by name)
Source: clone
Destination: /media/MX250

Advanced properties:
Exclude Templates:
  Temporary folders
  System mount folders
  Backup files
  # System folders - NO MARK
  Cache folders
Exclude User Defined:
Remote - Use remote host:
  User: rudi
  remote module: yes
  rsync password file: /etc/rsyncd.secret
Command options:
  Preserve ownership, times
  # Delete files on destination - NO MARK
  Preserver permissions
  Recurse into directories
  Preserve symlinks
  Skip newer destination files
  Preserve device, special files
Also execute:

Validate: Command to execute;
rsync -h --progress --stats -r -tgo -p -l -D --update --exclude=**/*tmp*/ --exclude=**/*cache*/ --exclude=**/*Cache*/ --exclude=**~ --exclude=/mnt/*/** --exclude=/media/*/** --exclude=**/lost+found*/ --exclude=**/*Trash*/ --exclude=**/*trash*/ --exclude=/cdrom/* --exclude=/home/rudi/.gvfs --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/var/lock --exclude=/var/cache --exclude=/var/run --password-file=/etc/rsyncd.secrets rudi@ /media/MX250/

List of pages in this category:

-- RudolfReuter 2011-01-31 11:10:27

Go back to CategoryHowTo or FrontPage ; KontaktEmail (ContactEmail)

RsyncDaemonMode (last edited 2011-03-23 09:00:52 by dslb-084-058-142-238)