We are running a mastodon instance, losely affiliated with van-magazine.com over at classicalmusic.social. It went down the other day, due to diskspace usage.
Blame myself for not having the watchdog installed, but here’s a script that might help you too to keep things clean in mastodon:
#!/bin/bash
# Prune remote accounts that never interacted with a local user
RAILS_ENV=production /var/www/mastodon/bin/tootctl accounts prune;
# Remove remote statuses that local users never interacted with older than 4 days
RAILS_ENV=production /var/www/mastodon/bin/tootctl statuses remove --days 4;
# Remove media attachments older than 4 days
RAILS_ENV=production /var/www/mastodon/bin/tootctl media remove --days 4;
# Remove all headers (including people I follow)
RAILS_ENV=production /var/www/mastodon/bin/tootctl media remove --remove-headers --include-follows --days 0;
# Remove link previews older than 4 days
RAILS_ENV=production /var/www/mastodon/bin/tootctl preview_cards remove --days 4;
# Remove files not linked to any post
RAILS_ENV=production /var/www/mastodon/bin/tootctl media remove-orphans;
~
save it as purge-media.sh and then have it running as cronjob all 3 hours.
0 */3 * * * /bin/bash /home/mastodon/purge-media.sh
Thanks ricard, for some inspiration.
CC Header pic from Thomas