주 메뉴 열기

wwiki β

Rsync

Jhkim (토론 | 기여)님의 2019년 6월 17일 (월) 00:38 판 (데몬모드(rsyncd))

목차

데몬모드(rsyncd)

[section]
comment = comment
path = path
uid = uid
# root도 지정가능
gid = gid
# / 경로를 사용하지 여부
use chroot = yes
read only = no
hosts allow = ip_address(192.168.0.1/24 127.0.0.1/8)
max connections = 5
timeout = 60

서비스 유닛에 정의된대로 /etc/rsyncd.conf 파일이 없으면 서비스가 시작되지 않는다.

$ sudo systemctl start rsync.service

명령모드(rsync)

SRC 디렉토리 생성여부

src path 끝에 / 가 있거나 . 이면 목적지에 src 디렉토리를 생성하지 않고 src디렉토리 내부만 복사한다.

$ rsync src/ dest 
$ tree dest
 ├── dir
 └── file
$ rsync src dest 
$ tree dest
 dest
  ├── dir
  └── file

옵션

-z, --compress compress file data during the transfer

--progress show progress during transfer

-a : archive mode

   -r : 재귀 복사
   -t : 타입스탬프 보존
   -l :  파일이나 디렉터리의 심볼릭 링크 보존
   -p : 권한 보존
   -g : 그룹 보존
   -o : 소유자 보존 - root 만 가능하다.
   -D : device 파일이나 special 파일 보존

-A, --perms 퍼미션을 유지한다. 기본옵션이다. 다른 유저로 실행할 때 의미가 있을 듯.

-x, --one-file-system 저장파일을 만들 때 로컬파일시스템 안에 작성