[NO-ISSUE] DB 백업을 최근 7개만 보관(개수 기준)하도록 변경#269
Conversation
RETENTION_DAYS 값만 조정하면 로컬 백업 삭제(find -mtime)와 Object Storage 백업 삭제(s3cmd) 양쪽에 동일하게 적용됩니다. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Walkthrough
ChangesDB 백업 보관 기간 단축
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
백업 주기와 무관하게 항상 최신 7개만 유지하도록 변경합니다. - RETENTION_DAYS → RETENTION_COUNT (=7) - 로컬: ls -1t 로 최신순 정렬 후 7개 초과분 삭제 - Object Storage: 파일명(날짜순) 정렬 후 (전체-7)개의 오래된 파일 삭제 (GNU 전용 head -n -N 대신 양수 head 로 견고하게 처리) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56babc6c44
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fi | ||
| fi | ||
| # 로컬 백업은 최신순으로 RETENTION_COUNT 개만 보관하고 나머지 삭제 | ||
| ls -1t $BACKUP_DIR/souzip-*.dump 2>/dev/null | tail -n +$((RETENTION_COUNT + 1)) | while read -r file; do |
There was a problem hiding this comment.
변경
DB 백업 보관 정책을 **최근 7개만 보관(개수 기준)**으로 변경합니다.
기존 날짜 기준(30일)에서, 백업 주기와 무관하게 항상 최신 7개만 유지하도록 바꿉니다.
deploy/shared/db-backup.sh:RETENTION_DAYS→RETENTION_COUNT(=7)ls -1t로 최신순 정렬 후 7개 초과분 삭제(전체-7)개의 오래된 파일 삭제head -n -N대신 양수head로 처리해 견고함검증
bash -n문법 검사 통과(10개 → 오래된 3개 삭제·최신 7개 보관 / 7개 이하 → 삭제 스킵)
참고
🤖 Generated with Claude Code