[solved] Delete old cached attachments?

Hi, I am running an instance and the attachments downloaded from other instances are reaching the tens of gigabytes now. This is not too worrisome, but will continue to grow indefinitely, with little benefit to my users long term.

Is there a way for me to delete old media attachments?

I am envisioning keeping local content indefinitely, and removing remote attachments after a 2-3 months, perhaps.

Is there a Rails console command I can use for that? If I do set it up that way, what will the UI look like for the affected posts? Is it clear that there exist attachments but they are not available locally (anymore)?


To answer my own question: A rake task exists, without configurable time period, so I filed: Make "remove remote media attachments" time period adjustable · Issue #3904 · tootsuite/mastodon · GitHub