Monday, July 16, 2007

Basic Rsync server setup

1. Install rsync

2. nano /etc/rsyncd.conf

-----------------------------------
  max connections = 2
log file = /var/log/rsync.log
timeout = 300

[pub]
comment = apa-apa aje
path = /path/ke/public/share
read only = yes
list = yes
uid = nobody
gid = nobody
auth users = pub
;hosts allow = 192.168.1.0/24
secrets file = /etc/rsyncd.secrets

----------------------------------

3. chmod a+r /path/tadi/laa

4. nano /etc/rsyncd.secrets dan masukkan

username:password
cth:
pub:pub

5. sebagai root chmod 600 /etc/rsyncd.secrets utk sekuriti

6. Setengah distro guna inetd dan setengah lagi guna xinetd..
pastikan mana satu daa

buat ni:-

  1. Jika inetd : "/etc/inetd.conf":

    rsync stream tcp nowait root /path/ke/rsync rsync --daemon

  2. Jika xinetd, ada kalanya file "/etc/xinetd.d/rsync" sudah ada jadi
    lakukan perubahan pada:


    disable = yes

    jadi:

      disable = no

    sekiranya file tadi tak ada.. buat file tu dan masukkan:

      service rsync
    {
    disable = no
    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
    }

7. kalau nak tukar port rsync ( default 873 )
boleh tukar di /etc/services


8.
killall -HUP inetd atau killall -HUP xinetd
untuk restart inetd dan xinetd


Test??
rsync rsync://pub@server-ko-la/
rsync rsync://pub@server-ko-la/pub/

utk download

rsync -v --progress --partial rsync://pub@server-ko-la/pub/fail
rsync -aPv rsync://pub@server-ko-la/pub/folder

gunakan cron utk sync folder seperti berikut

15 1 * * *      rsync -vazL rsync://pub@server-ko/pub/ /var/www/

No comments:

 Simple Python Calculator This script will allows your to calculate the integers given with the chosen operation. You can add, substract, mu...