Skip to content

rsync trash 무한 누적: 자동 purge 미작동 + vm_bundles 동기화로 17일간 13GB 적재 #26

@ComBba

Description

@ComBba

요약

rsync --backup-dir 기반 trash(~/.claudesync/trash/)가 자동 purge 없이 무한 누적되어, 한 대(MacBook Air)에서 17일간 13GB / 5,154개 폴더까지 증가했습니다. 체감 디스크 증가량은 주당 30GB 수준으로, 디스크 압박의 주요 원인입니다.

증거 (현장 데이터)

  • ~/.claudesync/trash 총량: 13GB, 하위 폴더 5,154개
  • 누적 기간: 2026-05-20 ~ 2026-06-05 (약 17일)
  • 일자별 생성 폴더 수 예시:
    • 2026-05-29: 194개
    • 2026-05-31: 445개
    • 2026-06-04: 1,379개 (하루 만에)
  • trash 내용물 상당수가 대용량 이미지의 이전 버전:
    • trash/<UUID>/vm_bundles/claudevm.bundle/*.rootfs.img* (수백 MB ~ 1.3GB 다수)
    • trash/<UUID>/.../logs_2.sqlite (107MB, 다수 복제)
    • trash/<UUID>/claudevm.bundle/sessiondata.img (수백 MB)

근본 원인

1. trash 자동 purge 미작동

  • docs/prd/PRD.md:558"Automatic purge: conflicts after 30 days, trash after 7 days. Configurable retention."
  • docs/prd/PRD.md:557"trash before delete ... 7-day retention."
  • docs/specs/TECHNICAL_SPEC.md:2281func pruneOlderThan(_ date: Date) 가 명세에 존재
  • 그러나 실제 환경에는 17일 전(5/20) 항목이 그대로 잔존 → purge가 스케줄/실행되지 않음.

2. 고변동 대용량 디렉터리(vm_bundles)가 동기화 대상에 포함

  • Claude Desktop 로컬 에이전트 모드의 ~/Library/Application Support/Claude/vm_bundles/(라이브 약 37GB)는 세션마다 GB급 rootfs 이미지를 재생성합니다(COW 스냅샷 다수).
  • 매 동기화 시 갱신된 멀티-GB 이미지의 이전 버전 전체가 backup-dir(trash)로 적재 → 폭증.
  • 현재 기본 exclude에는 Cache/, GPUCache/, blob_storage/ 등은 있으나 vm_bundles/는 없음.

제안 수정

  1. trash 자동 purge 활성화/스케줄링pruneOlderThan(now - 7d)를 동기화 주기 또는 별도 타이머(예: 기존 com.user.claude.prepush-cleanup LaunchAgent와 유사)로 실제 호출. conflicts(30일)도 동일.
  2. 기본 exclude에 고변동·재생성 가능 대용량 경로 추가:
    • vm_bundles/ (Claude Desktop 로컬 에이전트 VM 이미지 — 동기화 가치 낮고 변동 극심)
    • 필요 시 *.img, *.raw, Code Cache/, DawnWebGPUCache/
  3. trash 용량 상한(cap) 옵션 — retention과 별개로, 총량 또는 폴더 수 상한 초과 시 오래된 항목부터 제거.
  4. (선택) preferences.jsonextraExcludes로 사용자가 즉시 회피 가능하도록 문서화.

적용한 임시 조치(워크어라운드)

# 활성 rsync backup-dir(당일 UUID)는 보존, 1일 이상 경과분만 제거
find ~/.claudesync/trash -maxdepth 1 -mindepth 1 -type d -mtime +1 -print0 | xargs -0 rm -rf

12.62GB 회수 (실데이터/실행 중 동기화 무영향). 단, 근본 수정(자동 purge + exclude) 없이는 재발합니다.

환경

  • macOS (Apple Silicon), 시스템 rsync(openrsync) + Homebrew rsync 혼용 환경
  • 피어: MacBook Air ↔ MacBook Pro 양방향 동기화

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions