Have you posted this question on the lemmy_admin community over on lemmy.ml?
Or possibly joined their matrix chat as linked on their github project?
I suspect you will be able to get much more targeted support directly from the team or their community rather than the selfhosted community which is more general to all kinds of self hosting.
Sort by date created and delete oldest? Idk, I have no clue how Lemmy self-hosting works, but I guess that any picture you delete is a post that will be missing a picture.
I should've mentioned it in the post, but I already tried deleting pics modified more than X days ago. The catch is that I don't wanna delete pics uploaded to my server, I just want to delete pocs cached from other instances :(
S3 isn't always cheaper though... It's highly redundant storage (multiple copies in multiple data centers) so it's often going to cost more than a single copy on a single VPS or dedicated server or whatever. I guess in some cases it might end up cheaper compared to upgrading your storage to something larger though.
If you do want to migrate your images "to the cloud", Backblaze B2 should end up cheaper than S3.
You don’t pay for storing on multiple servers. I never saw something like this on any provider I know.
Upgrading storage is not cheaper. Instance media storage reaches 500GB in a month and S3 is always cheaper than data volumes with given options for pictrs.
Backblaze is not cheapest. It has egress fees so it will cost much more than others. Although its cheaper than AWS.
I'm interested in this as well. Mastodon has RAILS_ENV=production /home/mastodon/live/bin/tootctl preview_cards remove and RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove but I don't know if something equivalent exists for lemmy.
select distinct thumbnail_url as url from post where not local and thumbnail_url like 'https://campfyre.nickwebster.dev/pictrs%'
(replace with your instance's url)
I then sent delete requests to /internal/purge on pictrs to delete all of those old thumbnails, which cleared out a lot of space. After deleting the thumbnails I ran an UPDATE query to set all of those old thumbnail URLs to null in the DB. I also patched the version of lemmy that I run to stop caching thumbnails in the future. Hope this helps!