@gatewayy @gbhnews @ai6yr I run this once a week, it does a nice job of pruning. It's based on something I saw somewhere but can't find him to give jim credit.
#!/bin/bash
RAILS_ENV=production /home/mastodon/live/bin/tootctl media usage
# Prune remote accounts that never interacted with a local user
RAILS_ENV=production /home/mastodon/live/bin/tootctl accounts prune;
# Remove remote statuses that local users never interacted with older than 4 days
RAILS_ENV=production /home/mastodon/live/bin/tootctl statuses remove --days 30;
# Remove media attachments older than 4 days
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 15;
# Remove all headers (including people I follow)
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --remove-headers --include-follows --days 15;
# Remove link previews older than 4 days
RAILS_ENV=production /home/mastodon/live/bin/tootctl preview_cards remove --days 15;
# Remove files not link to any post
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove-orphans;