From fb19cb563743526b057da3436d08ca0e20f4b02c Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 29 Sep 2025 13:37:30 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Actions=20=EC=BA=90=EC=8B=9C=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0=EC=B1=85=20=EB=B0=8F=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=ED=99=94=20=EA=B5=AC=ED=98=84=20=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - cleanup-server.sh에 자동 캐시 정리 로직 추가 (line 66-75) - 매일 새벽 4시 crontab으로 7일 이상 된 Actions 캐시 자동 정리 - 의사코드 제거하고 정확한 파일 위치, 변수명, 명령어로 수정 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../250929_actions_cache_problem.md | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/troubleshooting/250929_actions_cache_problem.md b/troubleshooting/250929_actions_cache_problem.md index 6dd6752..0b58905 100644 --- a/troubleshooting/250929_actions_cache_problem.md +++ b/troubleshooting/250929_actions_cache_problem.md @@ -22,15 +22,38 @@ tags: [gitea, actions, cache, deployment] - .gitea/workflows/ 파일 변경 시에도 캐시 자동 갱신 안됨 ## 해결 방법 + +### 1. 즉시 해결 (수동) ```bash # Actions 캐시 강제 삭제 sudo rm -rf /root/.cache/act/ - -# 또는 특정 프로젝트만 -sudo rm -rf /root/.cache/act/*/프로젝트명/ ``` +### 2. 자동화된 해결책 (구현됨) +- **파일**: `/home/admin/scripts/cleanup-server.sh` (line 66-75) +- **스케줄**: crontab `0 4 * * * /home/admin/scripts/cleanup-server.sh` +- **로그**: `/mnt/hdd/logs/cleanup/cleanup-YYYYMMDD.log` +- **대상**: `/root/.cache/act` 디렉토리의 7일 이상 된 하위 디렉토리들 + +```bash +# 7. Actions 캐시 정리 (7일 이상 된 것) +echo "$(date '+%Y-%m-%d %H:%M:%S') - Actions 캐시 정리 중..." >> $LOG_FILE +if [ -d "/root/.cache/act" ]; then + ACT_CACHE_BEFORE=$(find /root/.cache/act -type d 2>/dev/null | wc -l) + find /root/.cache/act -type d -mtime +7 -exec rm -rf {} + 2>/dev/null + ACT_CACHE_AFTER=$(find /root/.cache/act -type d 2>/dev/null | wc -l) + echo "$(date '+%Y-%m-%d %H:%M:%S') - Actions 캐시 디렉토리: $ACT_CACHE_BEFORE -> $ACT_CACHE_AFTER" >> $LOG_FILE +else + echo "$(date '+%Y-%m-%d %H:%M:%S') - Actions 캐시 디렉토리 없음" >> $LOG_FILE +fi +``` + +## 해결 결과 (2025-09-29) +✅ **캐시 수동 삭제**: `/root/.cache/act/` 삭제로 즉시 문제 해결 +✅ **자동화 구현**: cleanup-server.sh에 캐시 정리 로직 추가 +✅ **향후 방지**: 매일 자동으로 오래된 캐시 정리하여 재발 방지 + ## 교훈 - Gitea Actions 워크플로우 수정 후 반영 안되면 act runner 캐시 확인 필수 -- 중요한 워크플로우 변경 시 캐시 삭제 후 재실행 -- 향후 act runner 업데이트로 개선 기대 \ No newline at end of file +- 캐시 문제는 자동화된 정리로 예방 가능 +- act runner의 캐시 메커니즘 이해 중요 \ No newline at end of file