"/live/public/system/media_attachments" getting way too big

My instance is small and requires approval for registration.

So far so good.

Why, then, is the entire fediverse able to store 18G of data on my server? I’d be fine with this, assuming most of it is duplicated elsewhere in the fediverse. However, I’m on Linode which recently went to the evil dark side in its billing practices when it switched to hourly billing. Now I keep running out of disk space.

How can I save only my local user’s files and delete everything else, so I don’t have to keep expanding my server and adding costs disproportionately to the rate at which I am accepting new users?

My short term solution was to buy some extra disk space, compress and copy over the entire /public/system directory to that new spot, and maybe go back and delete stuff.

tar -cvzf - ./system/* > /mnt/linodes_f*ing_expensive_diskspace/hugefingfilebck.tar.gz

Other ideas?

root@server:/home/mastodon/live/public/system# ls
accounts  custom_emojis  media_attachments  preview_cards  site_uploads
root@server:/home/mastodon/live/public/system# du -sh site_uploads/
206M	site_uploads/
root@server:/home/mastodon/live/public/system# du -sh accounts/
1.8G	accounts/
root@server:/home/mastodon/live/public/system# du -sh preview_cards/
747M	preview_cards/
root@server:/home/mastodon/live/public/system# du -sh media_attachments/
15G	media_attachments/
root@server:/home/mastodon/live/public/system# exit
logout

Found the solution:

$ RAILS_ENV=production bundle exec bin/tootctl media remove

Removed 19204 media attachments (approx. 11.4 GB)

1 Like

Here is another handy command:

tootctl statuses remove

Remove fediverse toots from the server that have no local interaction.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.