C.W.K.
Stream
Lesson 04 of 12 · published

rsync 핵심

~15 min · rsync, flags, archive-mode

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

다신 찾아볼 필요 없는 flag 표

Flag하는 일
-aArchive mode — -rlptgoD 등가 (recursive, symlink, perm, time, group, owner, device 보존)
-vVerbose — 전송 중 파일 나열
-z비행 중 compress (빠른 LAN 엔 빼)
--progress / -P파일별 progress bar (-P = --partial --progress)
-h사람이 읽는 크기
-n / --dry-run실행 없이 뭐 일어날지 보여줌
--delete출처에 없는 파일 목적지에서 제거
--exclude매칭 파일/디렉토리 건너뛰기
--exclude-from=file파일에 나열된 패턴 건너뛰기
--partialresume 위해 partial 파일 유지
--stats마지막에 전송 통계 출력
--bwlimit=NN KB/s 로 throttle
--checksummtime+size 대신 내용으로 비교 (느리고 정확)

Code

일상 레시피·bash
# Daily workhorse
rsync -avz --progress source/ dest/

# Dry run before any --delete
rsync -avzn --delete source/ dest/

# Sync to a backup, mirror exactly
rsync -avz --delete --stats source/ /Volumes/Backup/source/

# With exclusions
rsync -avz \
  --exclude '.git' --exclude 'node_modules' --exclude '.DS_Store' \
  source/ dest/

# Throttle on a metered network
rsync -avz --bwlimit=5000 source/ remote:/dest/   # ~5 MB/s cap

External links

Exercise

진짜 프로젝트 디렉토리 골라. rsync -avzh --stats --dry-run source/ host:/tmp/dest/ 돌리고 stats 읽어 — 총 파일, 총 바이트, 전송된 파일. 그다음 실제 실행. --exclude '.git' --exclude 'node_modules' 추가하고 바이트 수 극적으로 떨어지는 거 봐. 이 flag 가 cruft 에 대역폭 안 낭비하는 방법.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.