Skip to content

Instantly share code, notes, and snippets.

@ayoayco
Created July 8, 2023 09:52
Show Gist options
  • Save ayoayco/01069fdfba7cf81a732ffcd20d090ca8 to your computer and use it in GitHub Desktop.
Save ayoayco/01069fdfba7cf81a732ffcd20d090ca8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Delete all cached headers
rm -rf /home/mastodon/live/public/system/cache/accounts/headers/*
# 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 n days
RAILS_ENV=production /home/mastodon/live/bin/tootctl statuses remove --days 7;
# Remove media attachments older than n days
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 7;
# Remove all headers (including people I follow)
# RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --remove-headers --include-follows --days 0;
# Remove link previews older than n days
RAILS_ENV=production /home/mastodon/live/bin/tootctl preview_cards remove --days 7;
# Remove media orphaned
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove-orphans;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment