@xiasummer is looking for a way to search and delete large attachments (bigger than 10M) in their Discourse forum due to limited server space. @codinghorror suggests that a data explorer query would be useful for this purpose.
@pfaffman recommends using the Unix find command to locate large files in the /var/discourse/shared/standalone/uploads directory. However, @xiasummer is hesitant to delete files manually due to concerns about accidentally deleting system components.
@pfaffman advises that only upload files are stored in the uploads directory, and suggests listing the files before deleting them. @Mittineague cautions that deleting attachments should be considered carefully, taking into account their potential usefulness.
@xiasummer clarifies that their concern is about accidentally deleting system files, not the attachments themselves. @pfaffman reassures them that only uploads are stored in the uploads directory.
@rishabh mentions that a data explorer query for this purpose has been added, which can be used to search for large attachments.
Your see, the server I rented is not very bid. And I find people like to upload attachments in the discourse. I have already set the maximum size of the attachments, while still the discourse Backup file is still too big.
Is it possible that I can search for the big attachments(say bigger than 10 M) and I can delete the attachment.
I wouldn’t be so concerned about how much space they’re taking up without considering their potential usefulness.
For example, if a topic had been archived, unlisted and had not been visited in a long time (i.e. the chances anyone might still be interested in the attachment are extremely rare) then I guess it might be OK to delete them. It would probably only impact members that were using the forum for long term file storage.
The word dangerous I mentioned is not I’m afraid of deleting the attachments, I’m actually afraid of miss deleting other files eapecially some system components that will kill the discourse system. If I can delete these attachments one by one, I will delete them.