Rsync

From CBLFS
Revision as of 11:04, 16 April 2007 by Jciccone (talk | contribs)
Jump to navigationJump to search
Download Source: http://samba.anu.edu.au/ftp/rsync/rsync-2.6.9.tar.gz

Introduction to Rsync

ToDo

Dependencies

Optional

  • Popt (Has an included version)

Creating the rsyncd User/Group

groupadd -g 49 rsyncd &&
useradd -c "rsyncd Daemon" -d /home/rsync -g rsyncd -s /bin/false -u 49 rsyncd

Non-Multilib

Compile the package:

./configure --prefix=/usr &&
make

Install the package:

make install

Multilib

This package does not provide any libraries so only one installation is needed.

32Bit

ToDo

N32

ToDo

64Bit

ToDo

Configuring

If you would like to run the daemon create a config file and then the bootscript.

rsyncd.conf

Example configuration, See rsyncd.conf{5} and/or http://rsync.samba.org/documentation.html for more information:

cat > /etc/rsyncd.conf << "EOF"
motd file = /home/rsync/welcome.msg
use chroot = yes
uid = rsyncd
gid = rsyncd

[localhost]
  path = /home/rsync
  comment = Default rsync module
  read only = yes
  list = yes
EOF

BootScript

Create the bootscript:

cat > /etc/rc.d/init.d/rsyncd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/rsyncd
 
. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
        start)
                boot_mesg "Starting The RSYNC Daemon..."
                loadproc /usr/bin/rsync --daemon
                ;;

        stop)
                boot_mesg "Stopping The RSYNC Daemon..."
                killproc /usr/bin/rsync
                ;;

        restart)
                ${0} stop
                sleep 1
                ${0} start
                ;;

        status)
                statusproc /usr/bin/rsync
                ;;

        *)
                echo "Usage: ${0} {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/rsyncd
EOF
chmod -v 754 /etc/rc.d/init.d/rsyncd

Link it into the runlevels:

for link in /etc/rc.d/rc{{0,1,6}.d/K30,{2,3,4,5}.d/S30}rsyncd; do
  ln -sfv ../init.d/rsyncd $link;
done
Retrieved from "?title=Rsync&oldid=8763"