blob: f214effd1636f76e045024305f405a0eefef2cb1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
########
# clean up docker images
/usr/bin/docker system prune -f 2>&1 >/dev/null
# clear out old remote statuses that have never been touched (favorited, followed, etc)
# the "Content cache retention period" setting is significantly more aggressive since it removes *all* old remote posts
sudo docker-compose exec mastodon-web tootctl statuses remove --days 90
########
# these are useful maintenance tasks but already covered by other settings
# just turn autovacuum on
sudo docker-compose exec -u 70 db psql -c 'VACUUM ANALYZE;'
# covered by the new "Media cache retention period" setting
sudo docker-compose exec mastodon-web tootctl media remove --days 30
sudo docker-compose exec mastodon-web tootctl preview_cards remove --days 30
#########
# run these only with careful consideration, they're slow and may require taking the instance down for maintenance
# clear out nonextant remote accounts (this will nuke monsterpit and pv... :c )
sudo docker-compose exec mastodon-web tootctl accounts cull
# remove loose media files, quite slow but should save una a little bit of costs
sudo docker-compose exec mastodon-web tootctl media remove-orphans
# postgres vacuum full, requires instance down
# first line requies pgstattuple module
SELECT * FROM pgstattuple('table'); -- see if free_percent is high
VACUUM FULL table;
|