Linux: How-to Install Rsync in Debian Lenny


This mini how-to provides a comprehensive instruction on how to install Rsync in Debian Lenny (Linux). I’m using Rsync to synchronize files on several servers. Let’s install and configure rsync:

  1. Install rsynс
    apt-get install rsync
  2. Create a configuration file for rsyncd
    vi /etc/rsyncd.conf
    with the following content:

    log file=/var/log/rsyncd
    pid file=/var/run/rsyncd.pid
    socket options = SO_KEEPALIVE
    [www]
    comment = public archive
    path = /var/www
    use chroot = yes
    max connections=2
    lock file = /var/lock/rsyncd
    read only = yes
    list = yes
    uid = www-data
    gid = www-data
    auth users = wwwsync
    secrets file = /etc/rsyncd.secrets
    strict modes = yes
    hosts allow = 10.1.1.1 10.1.1.100
    ignore errors = no
    ignore nonreadable = yes
    transfer logging = yes
    log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
    timeout = 300
    refuse options = checksum dry-run
    dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz

    in the command hosts allow = you need to specify addresses from which you are going to sync files.

  3. Create a login and password in  /etc/rsyncd.secrets
    wwwsync:synhronizer

  4. In the file /etc/default/rsync replace a line RSYNC_ENABLE=false with RSYNC_ENABLE=true
  5. Run Rsync
    /etc/init.d/rsync start
  6. Check if Rsync ran
    ps xauw|grep rsync
    After the installation you should see the following:
    root 3935 0.0 0.3 3368 832 ? S 04:22 0:00 /usr/bin/rsync –no-detach –daemon –config /etc/rsyncd.conf
  7. Start synchronization (login:wwwsync password:synhronizer)
    rsync -rvt –progress wwwsync@www.local::www
    www.local should be replaced with ip or the server name where you are going to fulfill synchronization.

This is how to install and configure Rsync in Debian Lenny.

Bookmark and Share

Related Posts

, , , ,

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.