mmctl command to clean-up orphaned files
As it is now, we will probably have to write a custom lambda funtion that scans the entire S3 bucket, tries to match the files with the associated channels, and removes them if not found. Not even sure if this is possible, there are alot of id's in the pathname of the files, so my guess is one of them is the channel id, however, this we still need to confirm.
[Deleted User] commented
thanks for sharing
They don't care about cleaning up. I found this: https://forum.mattermost.com/t/data-retention-storage-maintenance-in-open-source-team-edition/11500
Anything like this has been ignored since day 1.
Try that repo linked there for building your own.