rsync

rsync is a very powerfull and multifunctional tool. It is at once a network rpotocull and on the other side a programm under the terms of the GPL for syncing files ( as example for backups ) over a network.

Installation

You can install rsync with Pakfire or by using the shell with:

pakfire install -y rsync

More Information (links)

HERE you can find a very good instruction for rsync.

You can find an instruction for incremental snapshots HERE (English); and HERE (German translation)

Instruction to backup files (Use of the shell is necessary)

In this example is rsync going to be installed on a host. This could be a client PC or the IPfire itself. After finishing this instructions you are able to load files with your client PC from the directory inside the configuration ( read only!!!)

create the rsync-server configuration (with nano or vi)

vi /etc/rsync.conf

Paste this content inside your file, optionally customize them:

uid = nobody
gid = nobody
use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
read only = yes

[hd1]
#Customize the directory 
path = /media/harddisk1
comment = Harddisk 1

The rsync server is read only so, the client isn't able to modify files.

Create the initscript

vi /etc/init.d/rsync

Paste the content again:

#!/bin/sh
# Begin $rc_base/init.d/rsync

# Based on sysklogd script from LFS-3.1 and earlier.

  . /etc/sysconfig/rc
  . $rc_functions

  case "$1" in
	start)
		boot_mesg "Starting rsync daemon..."
		loadproc rsync --daemon
		;;
	stop)
		boot_mesg "Stopping rsync daemon..."
		killproc rsync
		;;

	*)
		echo "Usage: $0 (start|stop)"
		exit 1
		;;
  esac

# End $rc_base/init.d/rsync

Change the permissions

chmod 755 /etc/init.d/rsync

Start the server

/etc/init.d/rsync start

Stop the server

/etc/init.d/rsync stop

Enable autostart of rsync

ln -s ../init.d/rsync /etc/rc.d/rc3.d/S65rsync<br>
ln -s ../init.d/rsync /etc/rc.d/rc0.d/K35rsync<br>
ln -s ../init.d/rsync /etc/rc.d/rc6.d/K35rsync<br>

Dissable autostart of rsync

rm /etc/rc.d/rc3.d/S65rsync<br>
rm /etc/rc.d/rc0.d/K35rsync<br>
rm /etc/rc.d/rc6.d/K35rsync<br>

Now the setup of the rsync-server is complete and you are now able to load files with your client PC.

rsync -a -c -P -stats spurcepc::hd1/files/ /backup/files/

This command syncs the files form the source PC (change it with your IP) inside the directory /media/harddisk1/files with (the chosen directory) your target computer: /backup/daten (directory on the client) As I allready told, rsync has been setuped as read only, but after you have read the instruction above, you should be able to change that.

en/addons/rsync/start.txt · Last modified: 2009/03/30 14:13 by Stevee
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki