Skip to main content


Okay, so I realized I might have to clear away some cache. My s3 bucket for our mastodon instance is around 2 TB.

So I searched a bit and found out I can run something like:

tootctl media remove
tootctl preview_cards

This should probably clear up quite a bit.

I can of course use the --days switch and do:

tootctl media remove --days 365

just to be sure I won't mess thing up too much :)

Any other admins that can give me some feedback?

ricard.dev/improving-mastodons…

#fediadmin #mastoadmin

in reply to Samuel

I run this script once a day:

---------------------------------
#!/bin/bash

PATH=$PATH:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/bin:/usr/local/bin:/usr/bin:/bin

RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 1
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 1 --remove-headers
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 1 --prune-profiles
RAILS_ENV=production /home/mastodon/live/bin/tootctl preview_cards remove --days 14
RAILS_ENV=production /home/mastodon/live/bin/tootctl statuses remove --days 14
RAILS_ENV=production /home/mastodon/live/bin/tootctl accounts prune

----------------------------
I don't need media older than one day (and if I do it will we downloaded again when visiting a toot)

in reply to arutaz

@arutaz Great! Thanks!

Are all those things that will clear cache stuff? I mean, stuff will be downloaded again if needed?

We can easily keep a couple of weeks content if needed. But I guess no one looks at content from one year ago.

in reply to Samuel

Yes.
Preview cards should not be set to lower than 14 days though because they will not be downloaded again (until older than 14 days I think).