본문 바로가기

728x90

rsync

[리눅스] 리눅스 환경에서 rsync 명령어로 데이터 동기화하는 방법 리눅스 환경에서 rsync 명령어로 데이터 동기화하는 방법 테스트 환경 구분 서버 이름 서버 아이피 디렉터리(데이터) 비고 source serv-A 1.1.1.1 /app/file target serv-B 2.2.2.2 /app/file SSH Key 교환 RSA 암호화 방식으로 SSH 공개키와 비공개키를 생성 root@serv-B:file$ ssh-keygen -t rsa SSH 공개키 복사(serv-B -> serv-A 복사) 공개기 복사할 때 패스워드 필요. root@serv-B:file$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@1.1.1.1 SSH 접속 테스트 root@serv-B:file$ ssh 'root@1.1.1.1' 데이터 동기화 스크립트 작성 rsync 명령.. 더보기
CentOS 7에서 lsyncd와 rsync를 사용하여 파일의 실시간 동기화를 설정하는 방법 CentOS 7에서 lsyncd와 rsync를 사용하여 파일의 실시간 동기화를 설정하는 방법 테스트 환경 운영체제 정보 $ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) 서버 정보 서버명 아이피 비고 bvm111 111.111.111.111 source bvm222 222.222.222.222 targe lsyncd와 rsync 설치 bvm111 서버와 bvm222 서버에 lsyncd, rsync 패키지 설치 EPEL 저장소 설치 sudo yum install -y epel-release lsyncd, rsync 패키지 설치 sudo yum install -y lsyncd rsync lsyncd 설정 파일 확인(lsyncd.conf) sudo.. 더보기
리눅스 rsync 명령어 rsync 명령어 사용법(Push) rsync [OPTION...] SRC... [USER@]HOST::DEST rsync -avzhpgoq /data/resize_img/2021/{01,02,03,04,05} root@1.1.1.1:/data/resize_img/2021/ 옵션 설명 -v, --verbose increase verbosity -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X) -r, --recursive recurse into directories -b, --backup make backups (see --suffix & --backup-dir) -u, --update skip files that are newer on the rece.. 더보기

728x90