IGOS Nusantara dan rsync beberapa komputer: Perbedaan revisi
(→Rsync beberapa komputer) |
|||
Baris 9: | Baris 9: | ||
=== 2. Konfigurasi rsync server === | === 2. Konfigurasi rsync server === | ||
− | Ada | + | Ada tiga file konfigurasi yang harus dibuat/diketik untuk menjalankan rsync server, yaitu: |
− | + | ||
− | + | ||
− | ==== | + | ==== /etc/rsyncd.conf ==== |
− | File /etc/rsyncd. | + | File /etc/rsyncd.conf adalah konfigurasi utama: |
− | + | ||
− | ==== | + | # /etc/rsyncd.conf |
− | Service atau daemon rsync dijalankan melalui xinetd, file konfigurasi ada di '''/etc/xinetd.d/rsync''', | + | use chroot = yes |
+ | read only = yes | ||
+ | pid file = /var/run/rsyncd.pid | ||
+ | max connections = 2 | ||
+ | motd file = /etc/rsyncd.motd | ||
+ | log file = /var/log/rsync.log | ||
+ | |||
+ | [ign2009] | ||
+ | comment=ign2009 melalui rsync | ||
+ | path=/home/repo/ign2009 | ||
+ | |||
+ | ==== /etc/xinetd.d/rsync ==== | ||
+ | Service atau daemon rsync dijalankan melalui xinetd, file konfigurasi ada di '''/etc/xinetd.d/rsync'''. Secara default service rsync tidak aktif, ada baris '''disable= yes'''. | ||
+ | |||
+ | '''SEMULA''' | ||
+ | # default: off | ||
+ | # description: The rsync server is a good addition to an ftp server, as it \ | ||
+ | # allows crc checksumming etc. | ||
service rsync | service rsync | ||
{ | { | ||
− | disable = | + | disable = yes |
+ | flags = IPv6 | ||
socket_type = stream | socket_type = stream | ||
wait = no | wait = no | ||
Baris 29: | Baris 44: | ||
log_on_failure += USERID | log_on_failure += USERID | ||
} | } | ||
+ | |||
+ | Ubah '''MENJADI''' | ||
+ | # default: off | ||
+ | # description: The rsync server is a good addition to an ftp server, as it \ | ||
+ | # allows crc checksumming etc. | ||
+ | service rsync | ||
+ | { | ||
+ | disable = no | ||
+ | flags = IPv6 | ||
+ | socket_type = stream | ||
+ | wait = no | ||
+ | user = root | ||
+ | server = /usr/bin/rsync | ||
+ | server_args = --daemon | ||
+ | log_on_failure += USERID | ||
+ | } | ||
+ | |||
+ | ==== /ect/rsyncd.motd ==== | ||
+ | File /etc/rsyncd.motd berisi pesan atau label | ||
+ | # echo "rsync server milik XYZ" > /etc/rsyncd.motd | ||
+ | |||
+ | === 3. Restart xinetd agar rsync daemon aktif === | ||
+ | # /etc/init.d/xinetd restart | ||
+ | |||
+ | === 4. Uji coba rsync === | ||
+ | |||
+ | Test di localhost | ||
+ | $ rsync localhost:: | ||
+ | |||
+ | Test dari komputer lain, misal rsync server memakai IP 192.168.1.5, ketik: | ||
+ | $ rsync 192.168.1.5:: | ||
=== 3. Buat konfigurasi di PC10 dan PC20 === | === 3. Buat konfigurasi di PC10 dan PC20 === |
Revisi per 8 Desember 2009 10.14
Rsync beberapa komputer
Ada kebutuhan dari seorang anggota milis IGOS Nusantara yang ingin membuat backup dari beberapa PC ke server backup. Hasil backup di server kemudian dapat diakses. Secara ringkas terdapat:
- Satu server, memakai IP 192.168.1.5
- Dua PC, diberi nama PC10=192.168.1.10 dan PC20=192.168.1.20
1. Install rsync
Saat melakukan instalasi dari IGN2009 DVD Installer, paket rsync telah terpasang. Jika rsync belum terpasang, lakukan:
# yum -y install rsync
2. Konfigurasi rsync server
Ada tiga file konfigurasi yang harus dibuat/diketik untuk menjalankan rsync server, yaitu:
/etc/rsyncd.conf
File /etc/rsyncd.conf adalah konfigurasi utama:
# /etc/rsyncd.conf use chroot = yes read only = yes pid file = /var/run/rsyncd.pid max connections = 2 motd file = /etc/rsyncd.motd log file = /var/log/rsync.log [ign2009] comment=ign2009 melalui rsync path=/home/repo/ign2009
/etc/xinetd.d/rsync
Service atau daemon rsync dijalankan melalui xinetd, file konfigurasi ada di /etc/xinetd.d/rsync. Secara default service rsync tidak aktif, ada baris disable= yes.
SEMULA
# default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable = yes flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
Ubah MENJADI
# default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable = no flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
/ect/rsyncd.motd
File /etc/rsyncd.motd berisi pesan atau label
# echo "rsync server milik XYZ" > /etc/rsyncd.motd
3. Restart xinetd agar rsync daemon aktif
# /etc/init.d/xinetd restart
4. Uji coba rsync
Test di localhost
$ rsync localhost::
Test dari komputer lain, misal rsync server memakai IP 192.168.1.5, ketik:
$ rsync 192.168.1.5::
3. Buat konfigurasi di PC10 dan PC20
PC10 membuat konfigurasi /etc/rsync.conf, isinya:
use chroot = yes read only = yes pid file = /var/run/rsyncd.pid max connections = 2 motd file = /etc/rsyncd.motd log file = /var/log/rsync.log [pc10] comment=pc1 Akses Umum path=/home/pc10/umum hosts allow=192.168.1.5 127.0.0.1
PC20 membuat konfigurasi /etc/rsync.conf, isinya:
use chroot = yes read only = yes pid file = /var/run/rsyncd.pid max connections = 2 motd file = /etc/rsyncd.motd log file = /var/log/rsync.log [pc20] comment=pc2 Akses Umum path=/home/pc20/umum hosts allow=192.168.1.5 127.0.0.1
Memakai rsync untuk backup
... akan ditulis ...
Memakai rsync untuk mirror
... akan ditulis ...