# 업로드 파일이 고아 처리되고 정리되지 않음

**URL:** https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036
**Category:** Support
**Created:** [3월 22, 2023, 1:47오후 UTC](https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036 "2023-03-22T13:47:52Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Uphill4721](https://avatars.discourse-cdn.com/v4/letter/u/f19dbf/32.png) [@Uphill4721](https://meta.discourse.org/u/Uphill4721)
#### Post date: [3월 22, 2023, 4:41오후 UTC](https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036/3 "2023-03-22T16:41:08Z")

</div>

빠른 답변 감사합니다!

이 문제를 해결하기 위해 시도하는 동안 해당 주제와 거기서 링크된 몇 가지 추가 주제에 대해 꽤 익숙해졌지만, unfortunately 이 문제의 결정적인 해결책은 제공되지 않았습니다.

어제 스테이징 서버에서 삭제된 지 9일 이상 지난 주제와 게시글을 대상으로 수정된 명령어를 실행했습니다:

> [@삭제된 게시물을 일괄적으로 영구 삭제할 수 있나요?](https://meta.discourse.org/t/delete-deleted-posts-permanently-in-bulk/203289/57):
>
> Excellent, glad to hear that did the job for you. So for the sake of combining the answers, one can use the following in the Rails console to destroy all topics that were deleted more than 90 days ago, repeating as many times as necessary if there are more than 1000 topics: Topic.with\_deleted.where(deleted\_at: ...90.days.ago).limit(1000).destroy\_all After that has completed, the following can be used to destroy all posts that have been orphaned from destroyed topics: Post.find\_by\_sql("select …

이후 tombstone 디렉토리의 콘텐츠 크기가 약간 증가하는 것을 확인했고, 아직 유예 기간(grace period)이 남아 있어 상황을 계속 모니터링하고 있습니다. 테스트 중에 대기 시간을 우회할 수 있는지, 관련 설정을 0시간/0일로 변경하면 되는지 궁금합니다.

이전에는 원본 서버에서 최신 게시글 수정본의 업로드를 제거해 보았지만, 유예 기간이 지나도 파일이 여전히 접근 가능했습니다.

이 시점에서 개인적으로는 다른 어디에도 참조되지 않는 주제 하나와 그 게시글 및 업로드를 영구적으로 삭제하는 작동하는 수동 해결책이라도 알게 된다면 매우 기쁠 것입니다. 하지만 이는 Discourse를 사용하는 다른 사람들에게 큰 문제가 될 수 있습니다. 관리 패널의 정리 설정이 설명된 대로 효과적일 것이라고 당연하게 생각하고, 실제로 그렇지 않다는 점을 반드시 알아차리지 못해, 영구적으로 삭제되어야 할 것으로 예상되는 민감한 업로드 파일들이 사실은 파일시스템에 남아 있는 상황이 생길 수 있기 때문입니다. 우리의 문제는 다행히 낭비된 저장 공간에 국한되어 있지만, 다른 누군가에게는 훨씬 더 심각한 문제가 될 수 있습니다.

2개월 전에도 비슷한 언급이 있었습니다:

> [@How to Delete Uploaded Files?](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/29):
>
> Huh! Looks like the image referred to in this post is not captured by these settings: Why has it not been deleted? May I also wonder why Discourse “uploads” a linked file such as the Dropbox link here? The point of linking a specific file will often be retaining control over content.

그러면, 이것이 우리 측의 잘못된 설정인지 아니면 실제 버그인지 어떻게 파악할 수 있는지 조언을 구합니다. 그 외에는 Discourse에 매우 만족하고 있으며, 이 문제를 해결하고 그 과정에서 다른 사람들을 도울 수 있기를 매우 열망하고 있습니다.

---

_[View the full topic](https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036)._
