Linux의 rsync 명령
페이지 정보

본문
rsync 명령은 서로 다른 위치 간의 파일과 디렉토리를 동기화하는 데 사용되는 Linux에서 가장 인기 있고 강력한 도구 중 하나입니다. 백업, 원격 파일 전송, 디렉토리 동기화에 널리 사용되며 증분 파일 전송, 압축, 파일 권한 보존과 같은 강력한 기능을 제공합니다.
사용법 :
rsync [OPTION]... SRC [SRC]... DEST
1. 기본 파일 동기화
rsync -av /source/directory/ /destination/directory/
2. SSH를 통한 파일 동기화
rsync -avz -e ssh /source/directory/ user@remote:/destination/directory/
3. 파일 및 디렉토리 제외
rsync -av --exclude 'file.txt' /source/directory/ /destination/directory/
4. 미완료 전송 재개
rsync -avP /source/directory/ /destination/directory/
5. 대상에서 파일 삭제
rsync -av --delete /source/directory/ /destination/directory/
6. 로컬 및 원격 시스템 간 파일 동기화
rsync -avz /local/directory/ user@remote:/destination/directory/
7. 디렉토리 백업
rsync -av /source/directory/ /backup/directory/$(date +%F)
****
iostat: rsync는 대용량 파일을 전송할 때 디스크 I/O에 영향을 미칠 수 있습니다. iostat과 같은 도구를 사용하여 전송 중에 디스크 성능을 모니터링할 수 있습니다.
df 및 du: 동기화하기 전에 df 명령으로 디스크 공간을 확인하고 du를 사용하여 디스크 사용량을 분석할 수 있습니다.
사용법 :
rsync [OPTION]... SRC [SRC]... DEST
1. 기본 파일 동기화
rsync -av /source/directory/ /destination/directory/
2. SSH를 통한 파일 동기화
rsync -avz -e ssh /source/directory/ user@remote:/destination/directory/
3. 파일 및 디렉토리 제외
rsync -av --exclude 'file.txt' /source/directory/ /destination/directory/
4. 미완료 전송 재개
rsync -avP /source/directory/ /destination/directory/
5. 대상에서 파일 삭제
rsync -av --delete /source/directory/ /destination/directory/
6. 로컬 및 원격 시스템 간 파일 동기화
rsync -avz /local/directory/ user@remote:/destination/directory/
7. 디렉토리 백업
rsync -av /source/directory/ /backup/directory/$(date +%F)
****
iostat: rsync는 대용량 파일을 전송할 때 디스크 I/O에 영향을 미칠 수 있습니다. iostat과 같은 도구를 사용하여 전송 중에 디스크 성능을 모니터링할 수 있습니다.
df 및 du: 동기화하기 전에 df 명령으로 디스크 공간을 확인하고 du를 사용하여 디스크 사용량을 분석할 수 있습니다.
2025년 최고의 리눅스 배포판 - 2025-01-17 (로봇)
댓글목록
등록된 댓글이 없습니다.