rsyncd
# cat /etc/rsyncd.conf
[ROOT]
path=/
comment=ANT
uid=root
gid=root
use chroot=yes
read only=yes
max connections=5
hosts allow = 113.30.102.xxx 222.96.155.xxx
# cat /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
rsync -av --delete 222.96.155.xxx::ROOT/home/web/ /home/web/
rsync -av --exclude=pds/ --exclude=phpMyAdmin/ 222.xxx.xxx.xxx::ROOT/home/web/jjangu/ /home/www_user/jjangu/
==========================================================================
1. 설치
- RPM : rpm -Uvh rsync-2.4.6-1.i386.rpm
2. 설정
- disable 확인 & xinetd.d restart & 포트 확인
# vi /etc/xinetd.d/rsync service rsync
} # /etc/rc.d/init.d/xinetd restart Stopping xinetd: [ OK ]
# nmap localhost 873/tcp open rsync |
- rsyncd.conf 설정 & 실행
# vi /etc/rsyncd.conf
# /usr/bin/rsync --daemon |
- 클라이언트에서 rsync 사용하기
# rsync -arvz zzz.z.zz.zzz(서버IP)::dir_name(서비스명)/backup_data.log(디렉토리 혹은 파일) /home/get_data/(저장할 위치)
-a : archive mode 심볼릭 링크, 속성, 퍼미션, 소유권등 보존
-v : verbose 상세 -r : recursive 순환 -z : compress 전송시 압축 -u : update only 새로운 파일을 덮어쓰지 않음 |
- rsync daemon start & check (873 port)
-데몬시작
/etc/rc.d/init.d/xinetd restart
-데몬확인
명령어 : telnet localhost 873
결과 : Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
@RSYNCD: 29
명령어 : netstat -na | grep LISTEN
결과 : tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN
Trackback Address :: http://jjangu.pe.kr/blog/trackback/559



